Shell level Two Menu

Source: Internet
Author: User

Today the weather is cloudy, a little bored, so boring to play like ...

#!/bin/bash#date:2017-6-20#version:1.0#author:xcn ([email protected]) menu  () {Cat <<END   1. [Install lamp]  2. [Install lnmp]  3. [exit]  pls input the num you want:end  read -t 15  a}menu1  () {cat <<end  1.[ Apche]  2. [Mysql]  3. [Php]  4. [back]  pls input the lamp menu num you want:  ******** end  read num1}menu2  () {cat <<end  1.[ Nginx]  2. [Mysql]  3. [Php]  4. [back]  pls input the lnmp menu num you want:  ******** end  read num2}#######################[  menu1   ]########################### #menu [  $a  -eq 1 ] && {  clear  menu1  [  $num 1 -eq 1 ] && {   echo  "Installing apache"   sleep 3  echo  "install is  Apacheed "  menu1}    [  $num 1 -eq 2 ] && {   echo  "Installing mysql"   sleep 3  echo  "Install is  mysqled "  menu1}[  $num 1 -eq 3 ] && {  echo   "installing php"   sleep 3  echo  "install is php"    menu1}[  $num 1 -eq 4 ] && {  echo  "return to  previous menu "  menu}}####################[  menu2  ]################ ########################[  $a  -eq 2 ] && {  clear   menu2  [  $num 2 -eq 1 ] && {  echo  "Installing nginx"   sleep  3  echo  "Install is nginx"   menu2}  [  $num 2 -eq 2  ] && {  echo  "Installing mysql"   sleep 3   echo  "install is mysqled"   menu2}[  $num 2 -eq 3 ] & & {  echo  "installing php"   sleep 3  echo  "Install  is php "  menu2}[  $num 2 -eq 4 ] && {  echo   "Return to previous menu"   menu}}[  $a  -eq 3 ] & & {  echo  "Baybay"   exit} Miracle appeared:[[email protected] ~]# sh  Menu.sh   1. [Install lamp]  2. [Install lnmp]  3. [exit]  pls input  the num you want:1  1. [Apche]  2. [Mysql]  3. [Php]  4. [back]  pls input the lamp menu num you want:  ******** 2installing mysqlinstall is mysqled  1. [Apche]  2. [Mysql]  3. [Php]  4. [back]  pls input the lamp menu num you want:  ******** *****************************


This article is from the "Little Rookie" blog, please be sure to keep this source http://baishuchao.blog.51cto.com/12918589/1941361

Shell level Two Menu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.