我正在发布我的脚本:
::::::脚本::::::
clear
echo -e '\E[44m'"Testing case conditions"; tput sgr0
until [ "$vpm" = "n" ]; do
read -p "Do you want to continue (Y/n): " vpm
case $vpm in
"Y" | "y" | "yes" | "Yes" | "YES" | "yES" | "yeS" | "YeS" | "YEs" | "yEs")
read -p "Pass your string: " sin
clear
echo -e '\E[42m'"$sin"; tput sgr0
sleep 3
;;
"n")
echo "Exit"
;;
* )
#echo "Invalid parameter" #At this line if user enter any thing else except of yes /n the script print invalid parameter but I want to break it after 3rd wrong input.**
;;
esac
done
exit 1
我想在第三次输入无效参数后退出此脚本。请指导我如何做到这一点。