Edit a file inplace..

2004-07-22 Thread Steve . E . Pittman




Hi,

I am trying to edit an ASCII file in place

I tried 

  perl -pi -ne s/ERROR/TRACKED/g status.log

and received

  Can't do inplace edit without backup

Any help is appreciated

Thanks,

Steve

Antwort: Edit a file inplace..

2004-07-22 Thread Manfred . Beilfuss
Hi,

didn't we have had this question shortly ?
As I, being a perl-newbie still, remember correctly you need
( at least under windows with active state )
a extension for a backup file !

If I write :
perl -pibak -ne s/ERROR/TRACKED/g status.log
it works under win2k with active-state-perl

Mit freundlichen Gruessen / Best regards

Manfred Beilfuss




   
   
[EMAIL PROTECTED]  
   
edstar.net   An: James Edward Gray II [EMAIL 
PROTECTED] 
 Kopie:  Perl Beginners [EMAIL 
PROTECTED], gohaku  
19.07.2004 17:56 [EMAIL PROTECTED]   

 Thema:  Edit a file inplace.. 
   
   
   
   
   
   
   








Hi,

I am trying to edit an ASCII file in place?

I tried ?

  perl -pi -ne s/ERROR/TRACKED/g status.log

and received?

  Can't do inplace edit without backup?

Any help is appreciated?

Thanks,

Steve





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Edit a file inplace..

2004-07-19 Thread James Edward Gray II
On Jul 19, 2004, at 10:56 AM, [EMAIL PROTECTED] wrote:


Hi,
I am trying to edit an ASCII file in place
I tried 
  perl -pi -ne s/ERROR/TRACKED/g status.log
Well, we definitely don't need -p and -n, since -p is -n plus some.
and received
  Can't do inplace edit without backup
Okay, let's try using a backup:
perl -pi.bak -e s/ERROR/TRACKED/g status.log
I believe Activestate Perl for Windows requires this.
Hope that helps.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response