stty -echo
stty,change and print terminal line settings.
stty -echo
It always use “-echo” parameter when input some characters could not seen by others, for example, password. We should echo the text for security reasons.
If the “stty -echo” command is executed, every typed characters were hidden, but the causing result displays as normal. How to dismiss this echo setting? Use a variable to keep the stty setting before echo typed character action.
# STTYSAVED=`stty -g`
-g:print all current settings in a stty-readable form
later, we could back to the former configuration for stty, # stty $STTYSAVED
every setting was recovered. We could see the typed characters again.
分类: 科技