Re: command line search and replace

2003-12-31 Thread drieux
On Dec 31, 2003, at 8:22 AM, Randy Brown wrote: Ah yes, now the real stumper: The line: perl -pi -e 's/file:.*<\/provider-url>/REPLACED/' testfile.txt does in fact work fine from the commandline in unix. However, when it is called from a ksh script, it does not function. Any ideas? I have trie

RE: command line search and replace

2003-12-31 Thread Randy Brown
tions that I can think of. Thanks very much. Randy -Original Message- From: drieux [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 30, 2003 7:04 PM To: Perl Beginners Mailing List Subject: Re: command line search and replace On Dec 30, 2003, at 4:51 PM, Randy Brown wrote: > When

Re: command line search and replace

2003-12-30 Thread drieux
On Dec 30, 2003, at 4:51 PM, Randy Brown wrote: When I try the following, perl reads the * as a literal character, instead of my intent as a global value. Anyone see what I am missing? perl -pi -e "s/file:*<\/provider-url>/REPLACED/g" testfile.txt you might want to revisit perldoc perlretut

command line search and replace

2003-12-30 Thread Randy Brown
Hi all, When I try the following, perl reads the * as a literal character, instead of my intent as a global value. Anyone see what I am missing? perl -pi -e "s/file:*<\/provider-url>/REPLACED/g" testfile.txt In the file testfile.txt, the line will be something like this: file:/opt/usr/bin/so

Re: [Re: Windows command line Search and Replace]

2003-06-16 Thread John W. Krahn
Greg Carrara wrote: > > Thanks for the response! However, when I try this > perl -pi -e "s/wordToFind/replaceWithThisWord/gi" *.ext > with ActivePerl 5.6.1, on Windows 2000, I receive the error: > > CAN'T DO IN PLACE EDIT WITHOUT BACKUP > > Could this have something to do with Perl not reading

RE: [Re: Windows command line Search and Replace]

2003-06-16 Thread Bakken, Luke
> Thanks for the response! However, when I try this > perl -pi -e "s/wordToFind/replaceWithThisWord/gi" *.ext > with ActivePerl 5.6.1, on Windows 2000, I receive the error: > > CAN'T DO IN PLACE EDIT WITHOUT BACKUP > > Could this have something to do with Perl not reading from > and writing to

Re: [Re: Windows command line Search and Replace]

2003-06-16 Thread GREG CARRARA
>"Jenda Krynicky" <[EMAIL PROTECTED]> wrote: >>From: GREG CARRARA <[EMAIL PROTECTED]> >> Hello, >> I'm trying to search for a word and replace it multiple files at a >> windows command prompt with the following: >> >> perl -pi -e 's/wordToFind/replaceWithThisWord/gi'*.fileExtension >> >> This e

Re: Windows command line Search and Replace

2003-06-13 Thread John W. Krahn
Greg Carrara wrote: > > Hello, Hello, > I'm trying to search for a word and replace it multiple files at a windows > command prompt with the following: > > perl -pi -e 's/wordToFind/replaceWithThisWord/gi'*.fileExtension > > This errors out. I've tried to replace the delimiters / with - to no

Re: Windows command line Search and Replace

2003-06-13 Thread Jenda Krynicky
From: GREG CARRARA <[EMAIL PROTECTED]> > Hello, > I'm trying to search for a word and replace it multiple files at a > windows command prompt with the following: > > perl -pi -e 's/wordToFind/replaceWithThisWord/gi'*.fileExtension > > This errors out. I've tried to replace the delimiters / with

Windows command line Search and Replace

2003-06-13 Thread GREG CARRARA
Hello, I'm trying to search for a word and replace it multiple files at a windows command prompt with the following: perl -pi -e 's/wordToFind/replaceWithThisWord/gi'*.fileExtension This errors out. I've tried to replace the delimiters / with - to no effect. Does someone know how to alter this