I am using a bash script the following menu:
#!/bin/bash
PS3='Please enter your choice: '
options=("Option 1" "Option 2" "Option3" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Option 1")
echo "you chose choice 1"
;;
"Option 2")
echo "you chose choice 2"
;;
"Option 3")
echo "you chose choice 3"
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done
After each menu selection, I just get a request using
Please enter your choice:
How to always show the menu after the completion of each option? I looked around a bit and I think I could make some kind of while loop, but I couldn’t get something to work.
source
share