'test' utility behavior question.

2010-08-30 Thread Oleksandr Gavenko
$ /bin/test -d echo ok ok $ /bin/test -d '' echo ok || echo must_be_error must_be_error POSIX require argument for -d, so behavior implementation depend. I can not check another 'test' implementation now. For me get error is more convenient, because this not break this code if $dir not

Re: 'test' utility behavior question.

2010-08-30 Thread Eric Blake
On 08/30/2010 11:27 AM, Oleksandr Gavenko wrote: $ /bin/test -d echo ok ok $ /bin/test -d '' echo ok || echo must_be_error must_be_error Both of these results match POSIX. Remember, POSIX describes different behaviors for one argument than for two arguments (for the one-argument case,

Re: 'test' utility behavior question.

2010-08-30 Thread Oleksandr Gavenko
On 2010-08-30 20:31, Eric Blake wrote: On 08/30/2010 11:27 AM, Oleksandr Gavenko wrote: $ /bin/test -d echo ok ok $ /bin/test -d '' echo ok || echo must_be_error must_be_error Both of these results match POSIX. Remember, POSIX describes different behaviors for one argument than for two