I\'m creating a Bash installer script which compiles and installs some libraries for both OSX and Linux. Because some commands in my script (\"make install\", \"apt-get install\
To get the password, just put sudo echo "Thanks." at the start of the script.
sudo echo "Thanks."
But I would prefer this solution:
if [[ $UID != 0 ]]; then echo "Please run this script with sudo:" echo "sudo $0 $*" exit 1 fi