I'm writing a script that executes scripts stored in a given directory, based on an array containing the filenames of the scripts.
Here's a section of my 'menu', just to clarify:
#######
Title: Test script 1
Description: Test script 1
To execute: 0
#######
Title: Test script 2
Description: Test script 2
To execute: 1
#######
I have an array named array that contains the names of the scripts with an index corresponding to the printed value under "to execute". Right now, I'm using a case statement to handle input and provide an exit option.
case $REPLY in
[Ee]) clear
exit;;
[[:digit:]] $scriptDirectory/${array[$REPLY]}
However, the [[:digit:]] expression only matches 0-9. I need a regex that works in the case statement that matches 0-999, or similar.