***** infoCopter.com/perl *****

Cool Stuff



Imagine you had to replace text within an amount of files at your shell prompt:

[retoh@talisker retoh]$ ls -l cool*.abc
-rw-rw-r--    1 retoh    retoh          12 Jun  5 08:19 cool-1.abc
-rw-rw-r--    1 retoh    retoh           6 Jun  5 08:19 cool-2.abc

To replace the string "BODY" with "body" within all files matching the search criteria just type:

find -name "cool*.abc" -print | xargs perl -pi -e "s/BODY/body/;"
© reto :)