1. 程式人生 > 其它 >Linux Shell 判斷當前使用者是否為Root

Linux Shell 判斷當前使用者是否為Root

技術標籤:LinuxShellshelllinux

#!/bin/bash

# 判斷當前使用者是否為root

if [ $UID -ne 0];then
	echo "is not Root"
	exit
else
	echo "is Root!"
fi