Michael D Schleif <mds@helices.org> [2003:10:04:16:32:37-0500] scribed:
> Dave selby <debian@pusspaws.net> [2003:10:04:19:25:32+0100] scribed:
> > I have multiple html files. I need to remove the same chunk of code from
> > all of them.
> > I have made a bash loop to feed the files to sed, but am struggling with
> > the sed code.
> >
> > I need to delete all the code between
> >
> > <!-- lockon:a:1
> > -->
> >
> > and
> >
> > <!-- lockoff
> > -->
> >
> > Including the above comments.
>
> Do you want to specify a range like this:
>
> sed '/<!-- lockon:a:1/,/<!-- lockoff/d' /tmp/tmp.txt
Oops! I forgot about the closing the lockoff comment:
# sed -f /tmp/tmp.sed /tmp/tmp.txt
# cat /tmp/tmp.sed
/<!-- lockon:a:1/,/<!-- lockoff/{
N
/-->/d
D
}
--
Best Regards,
mds
mds resource
877.596.8237
-
Dare to fix things before they break . . .
-
Our capacity for understanding is inversely proportional to how much
we think we know. The more I know, the more I know I don't know . . .
--
Attachment:
pgpX4xMks_Aqi.pgp
Description: PGP signature