=~
[ "$var" =~ .*foo[0-9]* ]
expr "$var" : ".*foo[0-9]*" > /dev/null
You are using =~ in a script declared to be compatible with POSIX sh or Dash.
=~ is not a POSIX operator and is unlikely to outside [[ ]] in Bash and Ksh.
[[ ]]
Use expr's : operator instead.
expr
:
None
There was an error while loading. Please reload this page.