bug-bash
[Top][All Lists]
Advanced

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

Re: AW: Built-in `test -a` returns incorrectly


From: Chet Ramey
Subject: Re: AW: Built-in `test -a` returns incorrectly
Date: Tue, 19 Nov 2024 09:24:25 -0500
User-agent: Mozilla Thunderbird

On 11/19/24 2:31 AM, Klüver, Tibor wrote:
Hi,

thank you both for the detailed explanation. I had fully forgotten about the binary meaning of -a. However, it makes me wonder why this isn't more visibly documented.

The current devel branch man page says this:


      The historical operator-precedence parsing with 4 or more  argu-
      ments  can  lead  to ambiguities when it encounters strings that
      look like primaries.  The POSIX standard has deprecated  the  -a
      and  -o  primaries and enclosing expressions within parentheses.
      Scripts should no longer use them.  It's much more  reliable  to
      restrict  test  invocations  to a single primary, and to replace
      uses of -a and -o with the shell's && and || list operators.


--
``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]