Date: Sun, 13 Aug 2000 10:30:21 +0300 (IDT)
   From: Eli Zaretskii <[EMAIL PROTECTED]>

   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.

Reply via email to