$ /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
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,
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
3 matches
Mail list logo