Re: test incorrectly rejecting valid expression with confusing ! placement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 04, 2013 at 01:20:00PM +1000, Herbert Xu wrote:
>  
> > "test ! -o !" is a three-argument test, where $2 (-o) is a binary
> > primary, so it is the binary test of $1 and $3, and the end result is an
> > exit status of 0.  Bash and ksh get it right, dash fails.
> 
> Both zsh and posh do it like dash:
> 
> $ zsh -c 'test ! -o !'; echo $?
> zsh:test:1: too many arguments
> 1
> $ zsh -c 'test ! = !'; echo $?
> 0
> $

Another case in point is 'test ! = -o a', here bash differs with
every other shell installed on my system, which all return 0, just
like dash.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux