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

2016-09-25 Thread Thorsten Glaser
Martijn Dekker dixit:

>Makes complete sense and I should have figured this out myself. Sorry
>for the noise and thanks for the references.

Oh well, others can still learn from it. (Note that -o for option is
also not POSIX, but POSIX rules still apply, and [[…]] doesn’t have
this problem.)

>I guess this explains why the POSIX spec does not include 'test -o' (or
>'test -a' as a synonym for 'test -e'). Not including them avoids this
>logical but unintuitive behaviour.

That, and it specificially says their spec is unambiguous only
because they require the argument for -t.

bye,
//mirabilos
-- 
Stéphane, I actually don’t block Googlemail, they’re just too utterly
stupid to successfully deliver to me (or anyone else using Greylisting
and not whitelisting their ranges). Same for a few other providers such
as Hotmail. Some spammers (Yahoo) I do block.


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

2016-09-25 Thread Martijn Dekker
Op 25-09-16 om 22:52 schreef Thorsten Glaser:
> Per XSI, -o is a binary primary:
[...]
> Well, $1 is '!' and therefore true. Same for $3, which is
> 'noclobber' and therefore true. That means that the result
> of -o is also true.

Makes complete sense and I should have figured this out myself. Sorry
for the noise and thanks for the references.

I guess this explains why the POSIX spec does not include 'test -o' (or
'test -a' as a synonym for 'test -e'). Not including them avoids this
logical but unintuitive behaviour.

- M.