问题描述:
【解答】
[root@A04-Test-172 scripts]# more menu.sh echo "1.[install lamp]"echo "2.[install lnmp]"echo "3.[exit]"read -p "pls input the num you want: " numcase $num in ???1) ??if [ -f "/server/scripts/lamp.sh" ]; ??then ??????echo "start installing lamp" ??????/server/scripts/lamp.sh ??????echo "lamp is installed" ??else ??????echo "the script /server/scripts/lamp.sh ?is not exist!" ??fi ??exit;; ??2) ??if [ -f "/server/scripts/lnmp.sh" ]; ??then ??????echo "start installing lnmp" ?????/server/scri[ts/lamp.sh ?????echo "lnmp is installed" ??else ????echo "the script /server/scripts/lnmp.sh is not exist!" ??fi ??exit;; ??3) ??exit;; ??*) ??echo "Input error" ??exit;;esac
使用shell打印菜单,一键安装Web应用
原文地址:https://www.cnblogs.com/xialiaoliao0911/p/8465964.html