shell擦除回显(不在终端显示)

gl@gl-pc ~ $ cat 1.sh
echo -e "enter password: "
stty -echo
read password
stty echo
echo
echo password read
gl@gl-pc ~ $ bash 1.sh
enter password:

password read
gl@gl-pc ~ $
gl@gl-pc ~ $
gl@gl-pc ~ $ read -s -p “enter password:” password
enter password:gl@gl-pc ~ $

你可能感兴趣的:(shell脚本)