coreutils
[Top][All Lists]
Advanced

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

Re: test: add string operators added by POSIX 2024


From: Pádraig Brady
Subject: Re: test: add string operators added by POSIX 2024
Date: Sat, 2 Nov 2024 14:06:14 +0000
User-agent: Mozilla Thunderbird Beta

On 02/11/2024 04:02, Collin Funk wrote:
Hi,

The 'test' command has the following change in POSIX 2024 [1]:

     Austin Group Defect 375 is applied, adding the
     pathname1 -ef pathname2, pathname1 -nt pathname2,
     pathname1 -ot pathname2, s1 > s2, and s1 < s2 primaries.

The -ef, -nt, and -ot operators are already implement in Coreutils.

This patch adds '>', '<' as documented [1]:

     s1 > s2
       True if s1 collates after s2 in the current locale; otherwise, false.
     s1 < s2
       True if s1 collates before s2 in the current locale; otherwise, false.

They are sort of annoying since they have to be quoted for the shell to
not interpret them as redirections. But now that they are standardized
they should probably be implemented. :)

Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/test.html


Excellent.
I added a NEWS entry and s/coreutils.txt/coreutils.texi/ in the commit message,
and pushed.

This also has the advantage of matching the behavior of bash and dash at least.

thanks!
Pádraig



reply via email to

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