Linux:case语句的基本用法举例
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
输入yes 或者no 用case命令
read -p "Please input yes or no: " ans
case $ans in
[Yy]|[Yy][Ee][Ss])
echo YES;;
[Nn]|[Nn][Oo])
echo NO;;
*)
echo input false!
esac
列出菜单
cat <<EOF
1:lamian
2:huimian
3:daoxiaomian
4:zhajiangmian
EOF
read -p "please choose the number: " num
case $num in
1)
echo "lamian price is 10";;
2)
echo "huimian price is 12";;
3)
echo "daoxiaomiao price is 14";;
4)
echo "zhajiangmian price is 15";;
*)
echo "INPUT false!"
esac
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献3条内容
所有评论(0)