bug-bash
[Top][All Lists]
Advanced

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

Re: Docco


From: Chet Ramey
Subject: Re: Docco
Date: Wed, 27 Mar 2024 09:04:46 -0400
User-agent: Mozilla Thunderbird

On 3/27/24 7:40 AM, Andreas Schwab wrote:

The check for whether the first argument is '!' is not performed,
because the "$2 is a binary primary" check comes first.  This is how
POSIX documents it.

FWIW, ksh parses it the other way round:

$ ksh93 -c '[ ! -a /tmp ]; echo $?; [ . -a /tmp ]; echo $?; [ - -a /tmp ]; echo 
$?'
1
0
ksh93: [: -: unknown operator
2

Bash uses the order POSIX specifies. -a and -o are binary primaries when
test gets three arguments.

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




reply via email to

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