我有以下代碼出來while循環的shell腳本
echo "Please Enter the Email Id"
while read -r email
do
if
echo "$email" | grep -v "awt"
then
echo "You entered a invalid email id please try again"
break
fi
echo "================You chose Email id as $email"
done
echo "Please Enter the user Name"
read -r name
echo "you entered $name"
echo Final email id $email
echo final name $name
當IAM試圖執行上面的代碼,蔭未能就進入第二個條件,那就是它不出來的循環。 我需要的是它應該問,直到用戶輸入正確的電子郵件ID之後,它應該去的下一組代碼的最後打印的最後echo語句
在'break'之前插入'else'。 – Cyrus