[ Content | View menu ]

Daily Archive September 30th, 2003

Search and Replace with Perl

September 30, 2003

# Sometimes you need to change something in a bunch of files at once. # These are some command-line ways of doing that. # For universal replacement (in all files down from the current directory): find ./ -type f -exec perl -pi -e \’s/stringtofind/stringtoreplacewith/g\’ {} ; # To do all “.php”s, for example: find ./ […]

code - Comments closed