Ok, so i've got this command that i'm playing with, which is a modification of an mp3gain command example that i seen; but my modification is not working, so i was wondering if i can even DO this in this way:
Code:
find '/home/1_Logic' -name *.php -exec sed 's/\$title/\$system['title']/g' {} \;
It does traverse through all of the files, but it doesn't replace anything. I tried with and without the backslashes. It made no difference.
Also tried this, with and without backslashes, to no avail:
Code:
find '/home/1_Logic' -name '*.php' | xargs perl -pi -e 's/$title/$system['title']/g'
I've also tried escaping the single quotes around the php array index, and even removing them altogether just to see if it works, to no avail...
I've also tried this, which seemed promising, but didn't work:
Code:
find '/home/1_Logic' -name '*.php' | xargs perl -w -p -i -e 's/\$title/\$system[''title'']/g'
Thanks
===EDIT===
Got it working!:
Code:
find '/home/1_Logic' -name '*.php' | xargs perl -w -p -i -e 's/\$title/\$system['"'"'title'"'"']/g'
Now i can update my ENTIRE frame work in 1 night, as opposed to 3 months

. A search and replace that would have taken me HOURS for each variable (i've got over 3,000 files in my framework) now takes less than 1 second!
===EDIT===
But i still can't figure out how to do something like this:
Code:
find '/home/0_Logic' -name '*.php' | xargs perl -w -p -i -e 's/\$system['"'"'http'"'"']/\$system['"'"'protocol'"'"']/g'
===EDIT===
Got it:
Code:
find '/home/0_Logic' -name '*.php' | xargs perl -w -p -i -e 's/\$system\['"'"'time'"'"'\]stamp/\$system['"'"'timestamp'"'"']/g'