I have a problem with my php-script when I call shell_exec and pass a regular expression.
PHP code :
shell_exec("sh myscript.sh 'FOO\s*ONE'");
myscript.sh :
result=$(grep -c "${1}" myLongFile.txt)
echo ${result}
Like this, it returns 0 but if il call directly with cmd grep -c "FOO\s*ONE" myLongFile.txt it returns 23.
And if i replace in my php script \s by the class [[:space:]] it's working, but I have to use \s
I tried many solutions but failed.