Trying to ensure the parameter to a script matches:
YYYY-MM (e.g. 2013-06)
It would seem this would be the desired pattern:
if [[ ! $1 =~ '[0-9]{4}-[0-9]{2}' ]] ; then
echo ' Usage: backup YYYY-MM'
exit
fi
However it will not match a valid YYYY-MM. Cluestick, anyone?
Thanks!
Lee