Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2016 14:11:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 206295] sh(1)/test(1) bug (precedence)
Message-ID:  <bug-206295-8-Hx4kNVJN1d@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-206295-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-206295-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206295

Jilles Tjoelker <jilles@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jilles@FreeBSD.org

--- Comment #1 from Jilles Tjoelker <jilles@FreeBSD.org> ---
(In reply to nibbana from comment #0)
This may not make much sense, but per a literal reading of the 'test' page =
in
POSIX.1-2008 XCU, the -a or -o indeed binds more strongly than the !. This =
is
because -a and -o are explicitly said to be "binary primaries" and therefor=
e ''
-a '' matches the first case of 3 arguments and ! '' -a '' matches the first
case of 4 arguments.

In bash, dash, zsh and yash, [ ! "" -a "" ] likewise returns true.

I recommend writing [ ! "" ] && [ "" ] or [ -z "" ] && [ -n "" ] instead.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206295-8-Hx4kNVJN1d>