RE: Search and replace pattern in a file

2004-01-19 Thread Hanson, Rob
Sorry, my bad. Forgot the -e switch... perl -pi.bak -e 's|ReplaceThis|WithThis|' * Rob -Original Message- From: Hanson, Rob Sent: Monday, January 19, 2004 8:04 PM To: 'Perl'; [EMAIL PROTECTED] Subject: RE: Search and replace pattern in a file I think you wil

RE: Search and replace pattern in a file

2004-01-19 Thread Hanson, Rob
I think you will like this, it does exactly whay you described... perl -pi.bak 's|ReplaceThis|WithThis|' * This does everything you want, AND makes a backup of each file. You can only perform a substitution on a single line though (AFAIK). See perldoc perlrun for all of the details. WARNING: M