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
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
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
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
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
> 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
>"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
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
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
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
10 matches
Mail list logo