[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed and less/greater than symbols
From: |
Tapani Tarvainen |
Subject: |
Re: sed and less/greater than symbols |
Date: |
22 Feb 2001 13:06:47 +0200 |
address@hidden (Eli Zaretskii) writes:
> On Wed, 21 Feb 2001, Gregory D. Henderson wrote:
>
> > I've been trying to use sed (v3.02) to operate on HTML files. It appears
> > that
> > the "<" and ">" cannot be used in substitutions.
>
> You should be able to use them by escaping them.
>
> > Escaping the symbols shouldn't be necessary,
>
> ??? AFAIK, these are meta-characters in GNU Sed, so why is it wrong to
> escape them?
They are not metacharacters in Gnu sed nor any sed that I know of.
Gnu sed supports '\<' and '\>' pairs as word delimiters but
otherwise < and > are just normal characters.
If escaping them were necessary Gnu sed would not be
standard-conforming (as per POSIX.2), but it is not:
$ echo '<>' | sed 's-<->x-'
>x>
That's with Gnu sed 3.02.
And I have used it to edit HTML files with no problems.
--
Tapani Tarvainen