On 2024-04-03 16:43:42 +0200, Vincent Lefevre wrote:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
> says for >4 arguments with XSI:
> 
>   In addition, the string comparison binary primaries '=' and "!="
>   shall have a higher precedence than any unary primary.
> 
> (note the "shall"). So, what about the following command?
> 
>   test ! = -o ! ''

Oops, "!" is not regarded as a unary primary.
However, same question for

  test -e = -o ! ''

Here, with ksh93u+m 1.0.8-1 under Debian:

$ test -e = -o ! '' ; echo $?                                                  
1

which I think it is wrong (with any meaning, I don't see how the
result could be 1, anyway). The other implementations regard this
as an error.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

  • behavior of test ! = ... Vincent Lefevre via austin-group-l at The Open Group
    • Re: behavior of ... Vincent Lefevre via austin-group-l at The Open Group
      • Re: behavior... Vincent Lefevre via austin-group-l at The Open Group
        • Re: beha... Martijn Dekker via austin-group-l at The Open Group
    • Re: behavior of ... Geoff Clare via austin-group-l at The Open Group

Reply via email to