I\'m writing a Bourne shell script and have a password input like this:
echo -n \'Password: \'
read password
Obviously, I don\'t want the p
You can use '-s' option of read command to hide user input.
echo -n "Password:"
read -s password
if [ $password != "..." ]
then
exit 1; # exit as password mismatched #
fi
Also you can use 'stty -echo' if you want to hide from terminal to print. And restore the terminal settings using "stty echo"
But I think for getting password input from user 'read -s password' is more than enough.