![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. Shell Script Page. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing global variable to a function which is called by another function | sars | Shell Programming and Scripting | 4 | 5 Days Ago 08:39 AM |
| My menu function [new code -revised] | amatuer_lee_3 | Shell Programming and Scripting | 3 | 05-18-2008 04:05 AM |
| CDE menu | gabim | AIX | 1 | 10-20-2003 03:17 AM |
| Sub menu's | Makaveli.2003 | UNIX for Dummies Questions & Answers | 20 | 01-21-2002 06:15 AM |
| Menu function stuck in a loop? | darthur | UNIX for Dummies Questions & Answers | 2 | 12-14-2001 12:16 PM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
My menu function
Below is my menu options code. It allows user to pick one of two option. I can get the first option to work, because if it is selected it just "breaks" and carries on with the script.
What i want to know is if a user selects option two how do i get that option to ignore all the other script and go to another specific part to carry out other commands??? ( i have indicated the problem by putting ########) Code:
while true; do
echo " "
echo "Main Menu: "
echo "Please Select An Option Using The Options Provided."
echo " "
echo "1 - Search All Files"
echo " "
echo "2 - Idex Page Information"
echo " "
echo "Q - Quit"
echo " "
echo "Please enter your option: "
read CHOSEN_KEY
case $CHOSEN_KEY in
[1]) echo " "
echo "You Have Selected To Search All Files For Hits"
break;; # By using break i carry on my script which works correctly.
[2]) echo " "
echo "You Have Selected To Access Index Page Information"
######;;
Q|q) echo " "
echo "Goodbye"
exit;;
esac
done
Last edited by amatuer_lee_3 : 05-17-2008 at 07:14 PM. |
| Forum Sponsor | ||
|
|
|
|||
|
What do you mean by "make my menu run"? What errors do you get? Do you have a problem starting it like
Code:
me@mybox$ mymenu.sh Code:
me@mybox$ ./mymenu.sh |
|
|||
|
Code:
[2]) echo " "
echo "You Have Selected To Access Index Page Information"
###What do i put here to make it go to a new set of funtions###;;
Code:
[2]) echo " "
echo "You Have Selected To Access Index Page Information"
readindex;;
###and have later in my code####
readindex () {
echo "hello"
}
Last edited by amatuer_lee_3 : 05-17-2008 at 06:40 PM. |