@veerain your suugestion works good, the only problem is when the user enters an invalid entry it errors out. Also since this you used the
if [ $ctrl -le 5 ]; then
is accepts the 0 value. I would like more of a graceful exit.
./test.sh: line 89: [: a: integer expression expected
@chrism01: your solution is working, however when the user selects the correct value. it just says "match" and exits. In my script if the ctrl value is valid I would like it to continue the script.
@pan64 thanks for your suggestion however I tried this in the past but do not know how to set up the regex.
case expression in $ctrl
"Continueing with script ;;
"Please Enter a whole number from 1-5 ONLY" ;;
Basically ctrl is a varible I set-up on a more elobrate script.