Tuesday, April 10, 2007

Prompting user for password in a shell script

echo "Enter Password"

# disable standard output
stty -echo

#prompt for password.
read password

#enable standard output
stty echo

echo $password

No comments: