I copied a script from bash tldp tutorial web-site. http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-9.html Trying to run this, I am getting the following error: only "else part" is working.
OPTIONS="Hello Quit"
select opt in $OPTIONS; do
if [ "$opt" = "Quit" ]; then
echo done
exit
elif [ "$opt" = "Hello" ]; then
echo "Hello World"
else
clear
echo bad option
fi
done
clearand whyif elseinstead of the more commoncase ... esac. – pLumo Aug 22 '19 at 10:32selectbuiltin expects you to type the number that is displayed alongside the selection - if you are typing the selection itself (HelloorQuit) it will be treated as a "bad option" – steeldriver Aug 22 '19 at 12:14