i have a file that has a list of routes to .sh files, but to execute the scripts a date is needed, it the file the date is YYYYMMD
. When I run the script that executes the list of scripts, i prompt the user for the date with the read
command.
My problem is that i need to be 100% sure that the date that the user inputs is at least all numbers, how can i do this? i have already made sure that the maximum chars inputed is 8, so all i need is to only allow the user to input numbers. This is all i have so far.
echo 'Input date (YYYYMMDD)'
read -n 8 date
Any ideas?
Thankyou.