home

Quickies, by Andrea Olivato

text

Find & replace multiple files with Perl

How to search and replace a string within some files with perl, launched from a shell.

# I'm looking for 'some' in all my .js files
# and I want to replace it with 'foo'
perl -pi -w -e 's/some/foo/g;' *.js

3 years ago

May 20, 2009
Comments (View)
blog comments powered by Disqus