还是看看code 吧:
root@oc2246430752 scripts]# cat main_menu.sh
#!/bin/bash
#############################
#File name:Main_menu.sh
#Author:david
#Create Date:2019-03-28
#############################
#Display main menu
while true
do
clear
echo -e "\n\n \t\t \033[40;32m ====Ansible Make Working Easy=====\033[1m \t\t"
echo -e "\n"
echo -e "\t"1\)Monitor Disk Usage
echo -e "\n"
echo -e "\t"2\)Server Status Check
echo -e "\n"
echo -e "\t"3\)Get and Give Files
echo -e "\n"
echo -e "\t"4\)ID related Tasks
echo -e "\n"
echo -e "\t"5\)Patching Related Tasks
echo -e "\n"
echo -e "\t"6\)Serive related Tasks
echo -e "\n"
echo -e "\t"7\)File related Tasks
echo -e "\n"
echo -e "\t"8\)Google for your time
echo -e "\n"
echo -e "\t"0\)Exit
echo -e "\n"
echo -e "Please choose task number..."
read choice #put the number in this parameter
case $choice in
0)
break;;
1)
echo "Now Checking disk usage..."
sleep 1
sh df_mail.sh
echo "Disk checking is completed. Press Enter to continue..."
continue;;
2)
echo "Now Choose which item need to check..."
sleep 3
sh status.sh
echo "Server checking is completed. Press Enter to continue..."
continue;;
3)
echo "Now Choose Proper Task items..."
sleep 2
sh gg.sh
echo "Task is completed. Press Enter to continue...."
continue;;
4)
echo "Please choose ID task ..."
sleep 2
sh id.sh
continue;;
5)
echo "Please choose patching task..."
sleep 2
sh patch.sh
echo "Task is completed. Press Enter to continue...."
continue;;
6)
echo "Choose the service Items..."
sleep 2
sh service.sh
continue;;
7)
echo "Please choose which File tasks ..."
sleep 3
sh file.sh
continue;;
8)
echo "Google is welcoming you. Press Enter to continue...."
sleep 3
gnome-open http://www.google.com > /dev/null 2>&1
continue
esac
done