DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

sttyecho's picture

Unregistered

Feeds

aliases

  • sttyecho

sttyecho

3 years ago

in Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes on Tech-Recipes
I also add the protection for the interruptions:

trap "stty echo ; exit" 1 2 15
stty -echo
read password
stty echo
trap "" 1 2 15

If the user press Ctrl+C in the password prompt, the normal stty mode will be restored
Returning? Login