![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | 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. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Awk - select from a list | simha77777 | UNIX for Dummies Questions & Answers | 14 | 02-07-2008 08:42 AM |
| Drop down menu in bash for timezone select | simonb | Shell Programming and Scripting | 1 | 04-29-2006 10:02 AM |
| Generating a list of choices in a menu | sysera | Shell Programming and Scripting | 7 | 01-05-2006 01:13 PM |
| dynamic Select menu | rawatds | Shell Programming and Scripting | 2 | 12-06-2004 01:54 AM |
| Dynamic select with multiple word menu items | domivv | Shell Programming and Scripting | 5 | 07-22-2004 05:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
reappearing menu list using select
is there a way I can make the menu list reappear when I use select ?
----- menulist="Change_title Remove_tag Change_tag Add_line Quit" select word in $menulist #change_title remove_tag change_tag add_line quit do case $word in # first menu option Change Title Change_title) ..... after choosing the first time and running the script, the menu option will not reappear, the script will only prompt #? instead of the whole menu list. thanks Steffen |
| Forum Sponsor | ||
|
|
|
|||
|
Code:
while [ 1 ] do select word in $menulist #change_title remove_tag change_tag add_line quit do if [ "$word" = "" ] then exit fi case $word in # first menu option Change Title Change_title) ..... done |
|
|||
|
i feel
Stefen, I think you should use the break statement for every 'case' option in the while loop. (i.e)
Code:
echo "Type Ctrl-C to Quit" menulist="Change_title Remove_tag Change_tag Add_line" while true do select word in $menulist #change_title remove_tag change_tag add_line quit do case $word in Change_title ) echo "You selected change-title";break;; Remove_tag ) echo "You selected to remove tag";break;; Change_tag ) echo "change tag";break;; Add_line ) echo "TO add line";break;; esac; done done |
|
|||
|
this works for the first 4 menu options, the menu will reappear.
However, I also have a fifth menu option Quit which is supposed to end the program, but now even if I choose option quit it will still jump back to the menu selection. I do not want to use Ctrl-c to quit the program Steffen |