« email2postmail | Home | How To Name Your Company »

Perl Oneliner: Recursive Search and Replace

By Michael Stepanov | February 15, 2007

I like Perl and I use it every day. It’s cool to make a simple scripts in one line to do some routine work. For example, my first Perl oneliner formats Apache log to be easy readable. Here is another good example of Perl onliner (it isn’t my actually). It makes a recursive search and replacement:
Perl -p -i -e 's/oldstring/newstring/g' `grep -ril oldstring *`

[via About: Perl]

Topics: , , , |

 RSS feed for comments on this post.

Comments