The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-29-2006
Lindarella Lindarella is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 12
String Replacement with Perl

I want to replace a string within a file using perl.

We have a line that gets commented out, and I want to replace that line now matter how it was commented out.

for example, I'd want to replace

###ES=PR1A with ES=PR1A

or

##LJW(9/16/26)ES=PR1A with ES=PR1A


I tried: perl -pi -e 's/ES=PR1A\Z/ES=PR1A/' filename

but the comments are not removed.

Thank you in advance for any guidance you can give..

Linda