码迷,mamicode.com
首页 > 其他好文 > 详细

打印菜单脚本

时间:2019-08-06 11:10:44      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:int   lamp   define   def   efi   UNC   put   erro   amp   

#!/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

打印菜单脚本

标签:int   lamp   define   def   efi   UNC   put   erro   amp   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!