in reply to Manipulating File Contents Interactively
I often combine Unix's find-exec and perl-pie like this:
$ find /path/to/files -name "*.xml" -exec perl -p -i -e 's/this/that/g +' {} \;
Depending on the snippet/string/filename relationship, you may be able to repeat the above, just changing find's -name and perl's "this" and "that":
$ find /path/to/files -name "*.txt" -exec -perl -p -i -e 's/these/thos +e/i' {} \;
Or you can create a simple perl or other script and use find to pass in the filename:
$ find /path/to/files -type f -exec changeIt.pl {} \;
|
|---|