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

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

thanks, but that still only prompts me #? instead of the menu list again

Steffen

chk this

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

Stefen, I think you should use the break statement for every 'case' option in the while loop. (i.e)

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.

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

use 'exit' instead of 'break' for the fifth option.

:smiley:

thanks
Steffen

quit ) exit;

yup, did that, just posted a happy face cause it worked :smiley:

thanks,
Steffen