On 2007-04-30 13:49:38 +0200, Vincent Lefevre wrote:
> [EMAIL PROTECTED]:~$ touch exists
> [EMAIL PROTECTED]:~$ [ ! -e exists ] || echo found
> found
> [EMAIL PROTECTED]:~$ [ ! -a exists ] || echo found
> [EMAIL PROTECTED]:~$

In fact, this seems to be the intended behavior, but the man page
is not well structured. It first says:

              ! expr True if expr is false.

but then, says something about the number of araguments. This part
should appear first. Moreover, the case "! -a file" is not handled
in the description:

    3 arguments
        If the second argument is one of the  binary  conditional
        operators listed above under CONDITIONAL EXPRESSIONS, the

As the first argument is !, the -a is a unary conditional operator
as described above, so we are not in this case.

        result of the expression is the result of the binary test
        using  the first and third arguments as operands.  If the
        first argument is !, the value is  the  negation  of  the
        two-argument  test  using the second and third arguments.
[...]

We are in this case.

        If the first argument is exactly ( and the third argument
        is  exactly ), the result is the one-argument test of the
        second argument.  Otherwise,  the  expression  is  false.
        The  -a  and -o operators are considered binary operators
        in this case.

But now, "in this case" is ambiguous. The man page should probably
have been said "when there are 3 arguments". And it should have been
said first. And above, instead of saying "If the second argument is
one of the binary conditional operators listed above under CONDITIONAL
EXPRESSIONS" (which is ambiguous, as seen), the man page should have
said "If the second argument is -a or -o".

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

Reply via email to