I\'m prompting questions in a bash script like this:
optionsAudits=(\"Yep\" \"Nope\")
echo \"Include audits?\"
select opt in \"${optionsAudits[@]}\"; do
This will do what you are asking for.
options=("option 1" "option 2");
while :
do
echo "Select your option:"
i=1;
for opt in "${options[@]}"; do
echo "$i) $opt";
let i++;
done
read reply
case $reply in
"1"|"${options[0]}"|"")
doSomething1();
break;;
"2"|"${options[1]}")
doSomething2();
break;;
*)
echo "Invalid choice. Please choose 1 or 2";;
esac
done