1、自己練習
#!/bin/bash a=0 while : do a=`expr $a + 1` if [ $a -lt 4 ] then echo -n -e " 輸入號碼1 到9 \n" read Num case $Num in 1|2|3|4|5|6|7|8|9) echo -e "you number is :$Num!" ;; *) echo "r錯誤號碼,遊戲結束!" break ;; esac else echo " 你的次數到了 " break fi done
1、自己練習
#!/bin/bash a=0 while : do a=`expr $a + 1` if [ $a -lt 4 ] then echo -n -e " 輸入號碼1 到9 \n" read Num case $Num in 1|2|3|4|5|6|7|8|9) echo -e "you number is :$Num!" ;; *) echo "r錯誤號碼,遊戲結束!" break ;; esac else echo " 你的次數到了 " break fi done