From: Akim Demaille <[EMAIL PROTECTED]>
   Date: 07 Jul 2000 19:53:35 +0200

   There is one question though: how sure are you of the portability of
   this \| construct?

I'm pretty sure it was in Unix Version 7.  I've been using it for
years.  The Hylafax administration scripts use it, and they're quite
portable.

I do know of one portability problem with \|.  It occurs when you OR
together the empty string (or zero) with the empty string.  For
example:

expr '' \| ''

GNU/Linux and POSIX.2 return the empty string for this case, but
traditional Unix returns '0'.  In the latest POSIX draft, the
specification has been changed to match traditional Unix's behavior
(which is bizarre, but it's too late to fix this).

The code that I sent avoids this portability problem by avoiding the
empty string.

Reply via email to