Perl Monk, Perl Meditation | |
PerlMonks |
in-place edit, regex, one-linerby ybiC (Prior) |
on Nov 24, 2000 at 01:20 UTC ( [id://43168]=perlquestion: print w/replies, xml ) | Need Help?? |
ybiC has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to replace all instances of img src="image.gif" with img src="/Images/image.gif" in about 100 HTML documents. Below is what I've come up with, which creates the .bak file properly, but leaves a zero-byte edited file. What am I overlooking?
perl -i.bak -n -e 's/img src=\"image\.gif\"/img src=\"\/Images\/image\.gif\"/g' file.html cheers,
Back to
Seekers of Perl Wisdom
|
|