I did have to do a lots of modification in almost 600 files, and i did it using Linux SED:
grep -ilr ‘UA-1234567-1’ * | xargs -i@ sed -i ‘s/UA-1234567-1/UA-9876543-2/g’ @
what it really does is replace the string UA-1234567-1 with UA-9876543-2
🙂
Your use of xargs is dangerous. To see why read: http://en.wikipedia.org/wiki/Xargs#The_separator_problem
$ echo UA-1234567-1 > “foo’bar'”
$ grep -ilr ‘UA-1234567-1’ * | xargs -i@ sed -i ‘s/UA-1234567-1/UA-9876543-2/g’ @
$ cat “foo’bar'”
UA-1234567-1
Consider using GNU Parallel http://www.gnu.org/software/parallel/ instead.
$ grep -ilr ‘UA-1234567-1’ * | parallel sed -i ‘s/UA-1234567-1/UA-9876543-2/g’
Watch the intro video to GNU Parallel at http://www.youtube.com/watch?v=OpaiGYxkSuQ
Tnx for the info i did not know that for some Unix there are problms with xargs as long as the lines do not contain ‘, ” or space.