linux - Checking if root inside bash script -
I want to know whether the script is running or not before the user can run but it does not seem to work. Currently logged in as root, but I think there is something wrong with syntax.
If [[EUID-0]]; Then echo "Sorry, you are not root." Exit 1 else echo "You are root, the script will continue." << code>
You have a place between if and [.
Comments
Post a Comment