sivhaga
IS-IT--Management
- Jun 3, 2008
- 25
Hi,
I have created a menu script having 3 main option.It works well. But I would like to have a submenus within an option.
Eg. 1.Start - ATP
- BILLING
2.Check - ATP
- BILLING
3.Kill - ATP
- BILLING
Therefore the only code that i can only Start ATP,Check ATP and Kill ATP. How do i add a submenu BILLING like if you choose to Start, then it has to display two options either you want to start ATP or BILLING.
My code so far is
while :
do
clear
echo "=================================================================================================== ===="
banner " ATP MENU"
echo " 1. Check all running processes"
echo " 2. Start all processes"
echo " 3. Kill all processes"
echo " Q. Quit"
echo "=================================================================================================== ===="
echo "Enter your menu choice [1-3 or q]: "
read userinput
case $userinput in
1) echo "Check all option selected\n\n"
CHECKATP
echo "Press any key to continue" ; read ;;
2) echo "Start all option selected\n\n"
STARTATP
echo "Press any key to continue" ; read ;;
3) echo "Kill all option selected"
echo "Press any key to continue" ; read ;;
[qQ]*) exit 0 ;;
*) echo "Please select choice 1,2,3 or q";
echo "Press any key to continue" ; read ;;
esac
done
I have created a menu script having 3 main option.It works well. But I would like to have a submenus within an option.
Eg. 1.Start - ATP
- BILLING
2.Check - ATP
- BILLING
3.Kill - ATP
- BILLING
Therefore the only code that i can only Start ATP,Check ATP and Kill ATP. How do i add a submenu BILLING like if you choose to Start, then it has to display two options either you want to start ATP or BILLING.
My code so far is
while :
do
clear
echo "=================================================================================================== ===="
banner " ATP MENU"
echo " 1. Check all running processes"
echo " 2. Start all processes"
echo " 3. Kill all processes"
echo " Q. Quit"
echo "=================================================================================================== ===="
echo "Enter your menu choice [1-3 or q]: "
read userinput
case $userinput in
1) echo "Check all option selected\n\n"
CHECKATP
echo "Press any key to continue" ; read ;;
2) echo "Start all option selected\n\n"
STARTATP
echo "Press any key to continue" ; read ;;
3) echo "Kill all option selected"
echo "Press any key to continue" ; read ;;
[qQ]*) exit 0 ;;
*) echo "Please select choice 1,2,3 or q";
echo "Press any key to continue" ; read ;;
esac
done