in reply to Replacing text inside lots of files
Use any other name than $l (or rather, $1). It ought to work then. I see no reason why not. Oh, and "wra" looks like another typo to me, just like the lack of a slash between the "s" and the backslash.
perl -i~ -pe 'if($ARGV ne $z){$f=$z=$ARGV;$f=~s/\.war$//;substr($_,-11 +)=$f.$/;}' *
update: Hmm... I actually like this better:
or this:perl -i~ -pe 'if($ARGV ne $z){$f=$z=$ARGV;$f=~s/\.war$//;s/.{10}$/$f/} +' *
perl -i~ -pe 'if($ARGV ne $z){$z=$ARGV; s/.{10}$/$z/; s/\.war$//}' *
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Replacing text inside lots of files
by harald (Initiate) on Nov 03, 2003 at 10:52 UTC | |
by delirium (Chaplain) on Nov 03, 2003 at 11:13 UTC | |
by harald (Initiate) on Nov 03, 2003 at 12:32 UTC |