trying to replace text patterns with dollar signs and ()s, can't get it to work. please help
find /var/www/vhosts/prod/xxx/ -name "*.php"|xargs perl -w -i -p -e "s/mysql_fetch_array\($res,MYSQL_ASSOC\)/mysql_fetch_assoc(\$res);/g"
|
feedback
|
|
I suspect that your shell is expanding A slightly more efficient variation without
| |||
|
feedback
|
|
You also need to escape the $, ( and ) symbols in the search regex, you've already escaped the $ in the replacement string correctly. With Perl 5.10.1 I have to use the -i.bak parameter to get this to work, otherwise the inplace edit switch complains that I don't have a backup.
| |||
|
feedback
|