I have php files with the flag like /* TEST */.
In the script, I have variables with this flag and the value to replace:
test="defined('_TEST') or die('Test test');"
testPattern="/* TEST */"
My code returns no errors, but flags aren't replaced:
find . -name "*.php" -exec sed -i -e 's/"$testPattern"/"$test"/g' {} \;