循环菜单脚本功能
#!/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
9199

被折叠的 条评论
为什么被折叠?



