Date: Sun, 13 Aug 2000 14:51:06 -0700 (PDT) From: Paul Eggert Message-Id: <200008132151.OAA05916@ruby.twinsun.com> To: eliz AT is DOT elta DOT co DOT il CC: meyering AT ascend DOT com, tr AT eth DOT net, djgpp-workers AT delorie DOT com, autoconf AT gnu DOT org In-reply-to: (eliz AT is DOT elta DOT co DOT il) Subject: Re: portability of sed's \{0,1\}? References: Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Date: Sun, 13 Aug 2000 10:30:21 +0300 (IDT) From: Eli Zaretskii I don't see any work-arounds suggested for these problems. Does anyone know how do you express \(foo\)\{0,1\} portably? There's no simple, general substitute for \(foo\)\{0,1\}, but you can generally get the effect that you want by using multiple sed commands. For example, here are two equivalent shell commands; the latter one avoids the portability problem with \{0,1\}. sed 's/^\([abcde]:\/\)\{0,1\}[^:]*: / /' sed -e 's/^[abcde]:\/[^:]*: /: /' -e 's/^[^:]*: / /' By the way, while testing these two commands, I discovered that the former command does not work correctly with Solaris 8 /usr/bin/sed, so Solaris 8 is another counterexample to the claim that \{0,1\} is portable. I'll write to the author of the sed FAQ about this.