[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] doc: The test "==" operator is a GNU extension.
From: |
Eric Blake |
Subject: |
Re: [PATCH] doc: The test "==" operator is a GNU extension. |
Date: |
Thu, 12 Nov 2020 12:23:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 |
On 11/12/20 12:07 PM, Pádraig Brady wrote:
> On 12/11/2020 17:17, Ben Pfaff wrote:
>> * doc/coreutils.texi (test invocation): Mark the "==" operator as a GNU
>> extension, to reduce the number of people who accidentally use it while
>> thinking it's portable.
>> ---
>> doc/coreutils.texi | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/doc/coreutils.texi b/doc/coreutils.texi
>> index 8d9320ca2..601b06300 100644
>> --- a/doc/coreutils.texi
>> +++ b/doc/coreutils.texi
>> @@ -13336,6 +13336,7 @@ True if the strings are equal.
>> @opindex ==
>> @cindex equal string check
>> True if the strings are equal (synonym for =).
>> +This form is a GNU extension.
>> @item @var{string1} != @var{string2}
>> @opindex !=
>>
>
> Well it's not GNU specific.
> Also I think it's proposed in POSIX, Eric?
The proposal has been floated before, but at the present, the current
thinking is that it is saner standardizing '[[' than it is to retrofit
'==' into '[', but even that is an uphill battle:
https://www.austingroupbugs.net/view.php?id=375
> I agree that we should mention its lack of portability though.
Concur.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org