Re: test incorrectly rejecting valid expression with confusing ! placement

2014-09-28 Thread Herbert Xu
On Wed, Sep 04, 2013 at 11:56:29AM +1000, Herbert Xu wrote: > Harald van Dijk wrote: > > Hi, > > > > Now that Herbert fixed the reported crash in test (in a far simpler > > manner than I had suggested, which I like), I did some more testing, and > > came across one case that does not currently wo

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-04 Thread Eric Blake
[adding the Austin Group] On 09/03/2013 11:03 PM, Herbert Xu wrote: > 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

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-03 Thread Herbert Xu
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

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-03 Thread Herbert Xu
On Tue, Sep 03, 2013 at 08:38:16PM -0600, Eric Blake wrote: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > states that there are only two operators "!" and "()", and specifically > mentions that -a and -o are binary primaries: Well, a primary is usually something that ca

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-03 Thread Eric Blake
On 09/03/2013 07:56 PM, Herbert Xu wrote: > Harald van Dijk wrote: >> Hi, >> >> Now that Herbert fixed the reported crash in test (in a far simpler >> manner than I had suggested, which I like), I did some more testing, and >> came across one case that does not currently work, and did not work in

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-09-03 Thread Herbert Xu
Harald van Dijk wrote: > Hi, > > Now that Herbert fixed the reported crash in test (in a far simpler > manner than I had suggested, which I like), I did some more testing, and > came across one case that does not currently work, and did not work in > the past, but is perfectly valid: > > $ src/d

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-08-26 Thread Harald van Dijk
On 26/08/13 13:19, Thorsten Glaser wrote: > Harald van Dijk dixit: > >> $ src/dash -c 'test ! ! = !' >> src/dash: 1: test: =: unexpected operator >> >> POSIX requires special behaviour for four-argument tests: > > Right but… > >> There are also some cases where test gives incorrect results when

Re: test incorrectly rejecting valid expression with confusing ! placement

2013-08-26 Thread Thorsten Glaser
Harald van Dijk dixit: >$ src/dash -c 'test ! ! = !' >src/dash: 1: test: =: unexpected operator > >POSIX requires special behaviour for four-argument tests: Right but… >There are also some cases where test gives incorrect results when >combining ! with -o … ‘-o’ is XSI, not POSIX. Do not expect

test incorrectly rejecting valid expression with confusing ! placement

2013-08-24 Thread Harald van Dijk
Hi, Now that Herbert fixed the reported crash in test (in a far simpler manner than I had suggested, which I like), I did some more testing, and came across one case that does not currently work, and did not work in the past, but is perfectly valid: $ src/dash -c 'test ! ! = !' src/dash: 1: test: