On Mon, 27 Sep 2004, Lee Hosty wrote:
> On Mon, 27 Sep 2004, John Allen wrote:
>> > On Monday 27 September 2004 15:19, Gareth Eason wrote:
> > > There is probably a better way, but I would crack out the perl on this
> > > one.
> > >
> >
> > Or
> > # perl -pi -e 's|<div class="foo"></div>|<div class="foo">TEST</div>|g' foobar.html
>> perl -pi.bak -e 'if (!($. % 3)) { s|<div class="foo"></div>|<div class="foo">TEST</div>|g; }" foobar.html
Bah, sorry. That last " should be a ' of course. Or just add:
if !($.%3)
to the end of Johns, like so:
perl -pi -e 's|<div class="foo"></div>|<div class="foo">TEST</div>|g if !($.%3)' foobar.html
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!