![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Awk - select from a list | simha77777 | UNIX for Dummies Questions & Answers | 14 | 02-07-2008 12:42 PM |
| Drop down menu in bash for timezone select | simonb | Shell Programming and Scripting | 1 | 04-29-2006 01:02 PM |
| Generating a list of choices in a menu | sysera | Shell Programming and Scripting | 7 | 01-05-2006 05:13 PM |
| dynamic Select menu | rawatds | Shell Programming and Scripting | 2 | 12-06-2004 05:54 AM |
| Dynamic select with multiple word menu items | domivv | Shell Programming and Scripting | 5 | 07-22-2004 08:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 |
|
||||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|