标签:密码 count function enter correct
function inpasswd {
read -s -p "Enter You Password:" passwd1
echo
read -s -p "Please Check Password" passwd2
echo
if [[ $passwd1 == $passwd2 ]]
then
echo "correct" && exit 1
else
echo "incorrect"
echo "Please Input Agin"
fi
}
count=1
while true
do
if [ $count -gt 3 ]
then
break
fi
inpasswd
((count++))
done
echo "Input 3 Times and exit ByeBye"
先放这。晚上再修改
本文出自 “流浪在海里的鱼” 博客,请务必保留此出处http://knowledgeq.blog.51cto.com/9549168/1881443
标签:密码 count function enter correct
原文地址:http://knowledgeq.blog.51cto.com/9549168/1881443