Tips: 本文创建于2018年8月16日,已超过 2 年,内容或图片可能已经失效!
本文共计220个字,预计阅读时长需要1分钟。
getchar(){
stty cbreak -echo
dd if=/dev/tty bs=1 count=1 2>/dev/null
stty -cbreak echo
}
printf "Please input your passwd:"
while : ;do
ret=`getchar`
if [ x$ret = x ]; then
echo
break
fi
str="$str$ret"
printf "*"
done
echo "Your password is : $str"