【1.1】shell基本实践——密码输入三次错误则结束
function checkPwd()
{
pwdCount=1
read -s -p "Please input the password: " thePwd
clear
while true; do
if [ "${pwdCount}" -ge 3 ]; then
echo "bye"
exit 1
fi
if [ "$thePwd" = "123456" ]; then
break
else
echo "Error: The password is error."
echo
read -s -p "Please input the password: " thePwd
clear
fi
pwdCount=`expr ${pwdCount} + 1`
done
} 相关推荐
laisean 2020-11-11
zhangjie 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
CARBON 2020-10-20
JohnYork 2020-10-16
xiaonamylove 2020-10-16
Julyth 2020-10-16