bug-bash
[Top][All Lists]
Advanced

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

Re: -a vs -e


From: Chet Ramey
Subject: Re: -a vs -e
Date: Thu, 05 Sep 2013 15:44:15 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

On 9/5/13 1:06 AM, kneufeld@gmail.com wrote:
> According to the man page, [ -a ] and [ -e ] should have the same behaviour.

`test' behaves according to the number of arguments supplied.  The rules
are explained in the manual.  The three-argument case is well defined:

     3 arguments
             The following conditions are applied in the order listed.
             If the second argument is one of the  binary  conditional
             operators listed above under CONDITIONAL EXPRESSIONS, the
             result of the expression is the result of the binary test
             using  the first and third arguments as operands.  The -a
             and -o operators are  considered  binary  operators  when
             there  are  three arguments.  If the first argument is !,
             the value is the negation of the two-argument test  using
             the second and third arguments.  If the first argument is
             exactly ( and the third argument is exactly ), the result
             is  the one-argument test of the second argument.  Other-
             wise, the expression is false.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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