#!/bin/bash
str="yhg123"
for ((i=1;i<=3;i++))
do
read -p "请输入密码: " yhg
if [ ${nb}a = {$str}a ];then
	echo "密码输入正确"
	break
else
	echo "密码输入错误。第i次机会"
fi
done