Title: RE: [Perl-unix-users] Substitution help needed

Craig,
     try this.

#!/usr/bin/perl -w

use strict;

my $s = "  ) in psfs1 extent size 400000 next size 100000 lock mode row;";
print "$s\n";
$s =~ s/\)/\)\;/;
print "$s\n";


Steve Aaron

-----Original Message-----
From: Craig Sharp [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 30, 2001 4:12 PM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Substitution help needed


Hi all,





I have several lines like the following in a file.  I need to make a substitution for the line.





I am reading the file into @lines.  I then loop through looking for the line.  When I find the line, I need to make the change.  Then I will write it out to a new file.





Here is the line:





  ) in psfs1 extent size 400000 next size 100000 lock mode row;





I need to substitute:





  );





I cannot figure out the regexp to put into s/xxx/xxx/; so the change will happen.





Thanks,





Craig A. Sharp


Unix Systems Administrator


DNS Administrator


Roush Industries


Office: 734-779-7282


Cell: 734-231-6769


Fax: 734-779-7807


[EMAIL PROTECTED]


====================================================


I have not lost my mind, it's backed up on tape somewhere!


====================================================





_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to