Bash builtin read command doesn't seem to support it, now I need to let user input a password while no echo should be displayed, what tool can I use?
Bash Input – Command Line Utility to Retrieve Password Without Echo
bashinput
bashinput
Bash builtin read command doesn't seem to support it, now I need to let user input a password while no echo should be displayed, what tool can I use?
Best Answer
stty -echo
turns off the terminal echo, which is the display you're talking about;IFS=
is necessary to preserve whitespace in the password;read -r
turns off backslash interpretation.In
bash
you can also useread -s
, but this feature isn't standard across shells.