________________________________
From: Tony Esposito [mailto:[email protected]]
Sent: Monday, August 24, 2009 14:09
To: Shawn H. Corey
Cc: Wagner, David --- Senior Programmer Analyst --- CFS;
Beginners Perl
Subject: Re: one liner in Windows to replace string
Looks good but it bombs ... the Perl interpreter crashes from
the DOS prompt ... using version 5.10.0 build 1005 from ActiveState.
I am running AS 5.8.9 and when I run from cmd32.exe, it
never comes back to me again. If I run under MKS Korn shell, then all is
fine using the code that Shawn provides. I am not doing the update, but
just printing out 14 files using the glob concept. So 5.10 aborts and
5.8.9 hangs. Not a good setup, but it is Windows. ;))
If you have any questions and/or problems, please let
me know.
Thanks.
Wags ;)
David R. Wagner
Senior Programmer Analyst
FedEx Freight Systems
1.719.484.2097 Tel
1.719.484.2419 Fax
1.408.623.5963 Cell
http://fedex.com/us
But it was better than what I had, that's for sure
This makes for a bit of a mind teaser thanks to it being on
Windoze ... :-)
________________________________
From: Shawn H. Corey <[email protected]>
To: Tony Esposito <[email protected]>
Cc: "Wagner, David --- Senior Programmer Analyst --- CFS"
<[email protected]>; Beginners Perl <[email protected]>
Sent: Monday, 24 August, 2009 14:49:47
Subject: Re: one liner in Windows to replace string
Tony Esposito wrote:
> I am happy that it works with double quotes BUT now, when I
try to get all files in a directory with a certain extension, the
following does not work ...
> perl -p -i.bak -e "'s/CONSTANT/VARIABLE/'" C:\***.txt
> does not like th leading * in the file name when I try to
pull all .txt files ...
> Help again.
perl -p -i.bak -e
"beg...@argv=map{glob}@ARGV}s/CONSTANT/VARIABLE/" C:\*.txt
-- Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.