Wednesday, January 16, 2008

Perl inline replacement

Sometimes you need to replace something in a bunch of files. And this something is quite complex, so you can describe it only with regular expressions, or, by some other reason you need to use perl in your replacement string. Here is a small sample I'm using:

perl -p -i -e "s/SEARCH_STRING/REPLACEMENT_STRIGN/g"

1 comment:

sathish said...

I need to do the same for a .gz file. Is there any option.?