Subject: Re: expr "foo" : '/'
To: Andrew Cagney <cagney@mac.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: current-users
Date: 02/06/2002 21:05:20
Andrew Cagney wrote:
> This is one for the POSIX police. Is:
>
> $ expr "foo" : '/'
> expr: syntax error
>
> correct? The java scripts contains the equivalent to the above. What
> makes it interesting is:
FWIW, this is no longer problem with -current expr(1), after it
has been reimplemented.
Another way to work around the precedence issue in 1.5 expr
is to use
expr "/$VAR" : '//'
which should DTRT and still be readable.
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-= Those who would give up liberty for a little temporary safety deserve =-
-= neither liberty nor safety, and will lose both. -- Benjamin Franklin =-