#!/bin/bash
while : ;do
char=`
stty cbreak -echo
dd if=/dev/tty bs=1 count=1 2>/dev/null
stty -cbreak echo
`
if [ "$char" = "" ];then
break
fi
passwd="$passwd$char"
echo -n "*"
done
原文:https://www.cnblogs.com/ooops/p/12421378.html