Q A - Z O N E
Pages
Home
HDFS
HIVE
LINUX
MY SQL
Shell Scripting
Sqoop
Python
Check if User is Root
#!/bin/bash
# Check if User is Root
read username
ROOT_UID=0
if [ "$UID" -eq "$ROOT_UID" ]
then
echo "You are a root user."
else
echo "You are not a root user"
fi
[prabhu@cxln4 ~]$
sh hello.sh
You are not a root user
Home
Subscribe to:
Posts (Atom)