Re: [BUG] false positive: [ ! -o optname ]

2016-09-25 Thread Chet Ramey
On 9/25/16 5:57 PM, Martijn Dekker wrote: > Op 25-09-16 om 22:40 schreef isabella parakiss: >> On 9/25/16, Martijn Dekker wrote: >>> The '!' operator in the legacy test/[ builtin does not invert the result >>> of the -o operator. Consequently the command >>> >>> [ ! -o

Re: [BUG] false positive: [ ! -o optname ]

2016-09-25 Thread Martijn Dekker
Op 25-09-16 om 22:57 schreef Martijn Dekker: > And indeed your interpretation does not apply to something like > "[ ! -e /tmp ]": > > $ [ -e /tmp ]; echo $? > 0 > $ [ ! -e /tmp ]; echo $? > 1 > > However, the supposed synonym -a acts differently: > > $ [ -a /tmp ]; echo $? > 0 > $ [ ! -a /tmp

Re: [BUG] false positive: [ ! -o optname ]

2016-09-25 Thread Martijn Dekker
Op 25-09-16 om 22:40 schreef isabella parakiss: > On 9/25/16, Martijn Dekker wrote: >> The '!' operator in the legacy test/[ builtin does not invert the result >> of the -o operator. Consequently the command >> >> [ ! -o noclobber ] >> >> amounts to a no-op, always

Re: [BUG] false positive: [ ! -o optname ]

2016-09-25 Thread isabella parakiss
On 9/25/16, Martijn Dekker wrote: > The '!' operator in the legacy test/[ builtin does not invert the result > of the -o operator. Consequently the command > > [ ! -o noclobber ] > > amounts to a no-op, always returning exit status 0. > > Proof: > > $ set -o noclobber && [

[BUG] false positive: [ ! -o optname ]

2016-09-25 Thread Martijn Dekker
The '!' operator in the legacy test/[ builtin does not invert the result of the -o operator. Consequently the command [ ! -o noclobber ] amounts to a no-op, always returning exit status 0. Proof: $ set -o noclobber && [ -o noclobber ] && [ ! -o noclobber ] && echo bug bug