[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed escaping question
From: |
Ralf Wildenhues |
Subject: |
Re: sed escaping question |
Date: |
Tue, 23 May 2006 21:07:55 +0200 |
User-agent: |
Mutt/1.5.11+cvs20060403 |
Hi Stepan,
* Stepan Kasal wrote on Tue, May 23, 2006 at 08:42:34PM CEST:
> On Tue, May 23, 2006 at 07:08:43PM +0200, Ralf Wildenhues wrote:
>
> > Conversely to the second half of the paragraph, can we be certain that
> > sed 's|a\|b||'
> >
> > does what I think it should do, namely remove a literal `a|b' from the
> > code, and not invoke alternation? Or should a different delimiter be
> > preferred for safety?
>
> I read the Posix definition right now, and I can confirm that it
> seems to define this meaning. (I don't know anything about actual
> implementations.)
I also think it should be interpreted that way. However, reality and
standards being only the same in theory, I already found
| GNU sed version 4.0.7
which does this:
$ echo 'a|b' | sed 's|a\|b|x|'
x|b
:(
At least it's fixed in 4.1.2.
Cheers, and thanks for the prompt response!
Ralf