Skip to content

Instantly share code, notes, and snippets.

@ancms2600
Created December 18, 2017 15:54
Show Gist options
  • Save ancms2600/cfd43c15adc45d74e6a6d0b26ba6d2b0 to your computer and use it in GitHub Desktop.
Save ancms2600/cfd43c15adc45d74e6a6d0b26ba6d2b0 to your computer and use it in GitHub Desktop.
Hidden bash password prompt
# from: https://unix.stackexchange.com/a/165494
echo -n "passwd: "; stty -echo; read passwd; stty echo; echo
some-program -p "$passwd"
passwd= # cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment