CartMetrix - Do you know yours?

« Somnambulist | Home | Deportment »

12/6/2006

Perl Search and Replace

perl -pi -e "s/SEARCH/REPLACE/" FILES

Example (from Awstats configuration):

perl -pi -e "s/AllowToUpdateStatsFromBrowser=0/AllowToUpdateStatsFromBrowser=1/" *.conf

If SEARCH is a file path, make sure and not beat your head for an hour. Escape the path breaks ('/') or change the regep delimiters (ex. '|'):

perl -pi -e "s|SEARCH|REPLACE|" FILES

Popularity: 10%

Trackback:

Related Posts

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It