I want to secure the execution of a program with a password. How can I ask the user to enter a password without echoing it?
stty_orig=$(stty -g) # save original terminal setting.
stty -echo # turn-off echoing.
IFS= read -r passwd # read the password
stty "$stty_orig" # restore terminal setting.