今天天气阴,有点儿无聊,就做了这么无趣的玩样儿。。。。。。
#!/bin/bash #Date:2017-6-20 #Version:1.0 #Author:xcn(baishuchao@yeah.net) menu(){ cat<<END 1.[installlamp] 2.[installlnmp] 3.[exit] plsinputthenumyouwant: END read-t15a } menu1(){ cat<<END 1.[APCHE] 2.[MysqL] 3.[PHP] 4.[BACK] Plsinputthelampmenunumyouwant: ************************************* END readnum1 } menu2(){ cat<<END 1.[Nginx] 2.[MysqL] 3.[PHP] 4.[BACK] Plsinputthelnmpmenunumyouwant: ************************************** END readnum2 } #######################[menu1]############################ menu [$a-eq1]&&{ clear menu1 [$num1-eq1]&&{ echo"installingapache" sleep3 echo"installisapacheed" menu1 } [$num1-eq2]&&{ echo"installingMysqL" sleep3 echo"installisMysqLed" menu1 } [$num1-eq3]&&{ echo"installingPHP" sleep3 echo"installisPHP" menu1 } [$num1-eq4]&&{ echo"returntoprevIoUsmenu" menu } } ####################[menu2]######################################## [$a-eq2]&&{ clear menu2 [$num2-eq1]&&{ echo"installingNginx" sleep3 echo"installisNginx" menu2 } [$num2-eq2]&&{ echo"installingMysqL" sleep3 echo"installisMysqLed" menu2 } [$num2-eq3]&&{ echo"installingPHP" sleep3 echo"installisPHP" menu2 } [$num2-eq4]&&{ echo"returntoprevIoUsmenu" menu } } [$a-eq3]&&{ echo"baybay" exit } 奇迹出现: [root@XCN~]#shmenu.sh 1.[installlamp] 2.[installlnmp] 3.[exit] plsinputthenumyouwant: 1 1.[APCHE] 2.[MysqL] 3.[PHP] 4.[BACK] Plsinputthelampmenunumyouwant: ************************************* 2 installingMysqL installisMysqLed 1.[APCHE] 2.[MysqL] 3.[PHP] 4.[BACK] Plsinputthelampmenunumyouwant: *************************************原文链接:https://www.f2er.com/bash/392522.html