循環菜單腳本功能
#!/bin/bash
#
cat <<!
1) 北京烤鴨
2) 佛跳牆
3)小龍蝦
4)羊蠍子
5)火鍋
6)點菜結束
!
sum=0
while read -p "請點菜(1-6): " MENU ;do
case $MENU in
1)
echo The price is 100
let sum+=100
;;
2)
echo The price is 88
let sum+=88
;;
3)
echo The price is 66
let sum+=66
;;
4)
echo The price is 166
let sum+=166
;;
5)
echo The price is 200
let sum+=200
;;
6)
echo "點菜結束,退出"
break
;;
*)
echo "點菜錯誤,重新選擇"
;;
esac
done
echo sum=$sum