When using the select command, there is usually *) which would capture anything not in the select menu and run whatever code follows, sort of an error checking strategy.
varone="Test one"
vartwo="n"
PS3=$'nEnter one above: '
select rb in "$varone" "$vartwo" "Exit"; do
case $rb in
"$varone")
echo "bingo"; break;;
"$vartwo")
echo "bango"; break;;
"Exit")
break;;
*)
break;;
esac
done
This requires an input and enter key.
Can this be setup in a way that would capture the enter key alone as input. Without the need to provide any other key press; the enter key alone would trigger the select commands code for that menu option?
I’ve tried some things like assigning $'"n"', n, rn, '' etc to the vartwo variable to no avail.