首页 > 其他 > 详细

打印菜单脚本

时间:2019-08-06 09:55:40      阅读:126      评论:0      收藏:0      [点我收藏+]
#!/bin/sh
#auto to print menu shell
#by zkg 2019-08-06

#define menu function

menu(){
cat << EOF
1.[install lamp]
2.[install lnmp]
3.[exit]
please input the num you want:
EOF
}
menu
read num

[ "$num" = "1" ]&&{
echo "start install lamp"
[ -x /opt/shell/lamp.sh ]||exit 2
sh /opt/shell/lamp.sh
exit 0
}

[ "$num" = "2" ]&&{
echo "start install lnmp"
[ -x /opt/shell/lnmp.sh ]||exit 2
sh /opt/shell/lnmp.sh
exit 0
}

[ "$num" = "3" ]&&{
echo "bye"
exit 0
}
echo "input error"
exit 0

打印菜单脚本

原文:https://blog.51cto.com/1009516/2426905

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!