Re: sed escaping question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux