bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditional expression problem: both "-a file" and "! -a file" retur


From: Paul Jarc
Subject: Re: Conditional expression problem: both "-a file" and "! -a file" return true
Date: Thu, 12 Jan 2006 13:57:21 -0500
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux)

Eric Blake <ebb9@byu.net> wrote:
> But the RATIONALE (XCU line 35443) states that "The ! operator has higher
> precedence than the -a operator, and the -a operator has higher precedence
> than the -o operator."  Therefore, when -a is defined as a unary operator,
> an XSI compliant test is required to return failure for "test ! -a file"
> if file exists.  Bash got this wrong, so indeed it is a bug.

No, I think that quote only says that this:
  ! 1 -a 2
is the same as this:
  ( ! 1 ) -a 2
and not this:
  ! ( 1 -a 2 )

It doesn't give us any guidance for deciding whether ! is an operator
or operand in any particular case.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]