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