|
From: | Paolo Bonzini |
Subject: | Re: [PATCH 1/3] Properly expand @configure_input@ in config.status. |
Date: | Sun, 06 Jan 2008 17:43:59 +0100 |
User-agent: | Thunderbird 2.0.0.9 (Macintosh/20071031) |
1) echo 'axaaxaaaxa{1,2}' | sed 's{a\{1,2\}{b{g' a) axaaxaaaxb GNU b) ERROR Darwin, FreeBSD, NetBSD, OpenBSD, IRIX c) bxbxbbxb{1,2} AIX, HP-UX, Solaris, Tru64 2) echo abca.c | sed 's.a\.c.xyz.g' a) xyzxyz Darwin, FreeBSD, GNU, IRIX, NetBSD, OpenBSD b) abcxyz Solaris, AIX, HP-UX, Tru64
So BSD, IRIX, GNU behave the same in that they strip the slash before passing it to the regex matcher. (GNU is more lenient in that it does not check for balanced parentheses). AIX, HP-UX, Solaris, Tru64 are in the other camp (compatible with GNU sed up to 4.0.x).
3) echo 'abc' | sed 's1a\(b\)c1A\1C1g' a) A1C GNU b) AbC AIX, Darwin, FreeBSD, HP-UX, IRIX, NetBSD, OpenBSD, Solaris, Tru64
Hmm, so on the RHS on the other hand the string is passed as-is. It is interesting that for digits, GNU sed is the only one to follow Paul's interpretation ("\x produces literal character x") of SUSv3. :-)
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |