Good day to all,
I was wondering how to evaluate a string variable into a range, is it possible?
S=CUESTIONARIO15 ; if [ "$S" == "${S:0:12}*[0-9][0-9]*" ] ;then echo 999 ;fi
Thanks so much in advance for any clue
You can match against globs using [[
:
S=CUESTIONARIO15
if [[ "$S" == "${S:0:12}"*[0-9][0-9]* ]]
then
echo 999
fi
Make sure to use bash and not sh, and make sure not to quote the globbing characters in the pattern.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments