Answers for "how to check bash runs with sudo"

0

how to check bash runs with sudo

if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

#Note:
If you get 2: [: Illegal number: check if you have #!/bin/sh at the top
and change it to #!/bin/bash.
Posted by: Guest on January-20-2022

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language