bug-bash
[Top][All Lists]
Advanced

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

Re: Bash -f Test Operator - Not working as expected


From: Chet Ramey
Subject: Re: Bash -f Test Operator - Not working as expected
Date: Tue, 2 May 2017 09:38:30 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.0.1

On 5/2/17 9:07 AM, Eduardo Bustamante wrote:
> On Tue, May 2, 2017 at 7:13 AM, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
> [...]
>> would be safe.  Your test command has 6 arguments, for which "the results
>> are unspecified".
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
> 
> Hm. That section of the standard refers to "The algorithm for
> determining the precedence of the operators and the return value that
> shall be generated is based on the number of arguments presented to
> test.". I don't understand why the standard would introduce the -a /
> -o primitives, only to make their use unspecified a few paragraphs
> later.

They're marked obsolescent. The reason for including them is to permit
existing behavior, so that as many implementations as possible are
conformant. They're marked as unspecified because that existing behavior
differs.

The standard is as explicit as standards get about advising people to
not use them.

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



reply via email to

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