The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-13-2006
forever_49ers forever_49ers is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 23
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
  #2 (permalink)  
Old 09-13-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
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
  #3 (permalink)  
Old 09-13-2006
forever_49ers forever_49ers is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 23
thanks, but that still only prompts me #? instead of the menu list again

Steffen
  #4 (permalink)  
Old 09-13-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
chk this
Code:
PS3='Choose your word: '
while [ 1 ]
do
select word in "change_title" "remove_tag" "change_tag" "add_line" "quit"
do
if [ "$word" = "" ]
then
   exit
fi
echo $word
break
done
done
  #5 (permalink)  
Old 09-13-2006
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
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
To quit, you would have to use Interrupt.
  #6 (permalink)  
Old 09-13-2006
forever_49ers forever_49ers is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 23
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0