help-bash
[Top][All Lists]
Advanced

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

Re: >= and <= for string comparison


From: Ruiyang Peng
Subject: Re: >= and <= for string comparison
Date: Wed, 18 Jan 2023 18:03:26 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Thunderbird/109.0

On 2023/1/18 16:57, Tapani Tarvainen wrote:
On Wed, Jan 18, 2023 at 05:36:46PM +0900, Koichi Murase 
(myoga.murase@gmail.com) wrote:

If we decide to support `<=' and `>=' for strings, to me, the cleanest
solution seems to be reorganizing the lexical rule inside [[ ... ]] to
accept <= and >= as single tokens though it would introduce
incompatibilities.
IMHO that's the only alternative that makes sense. Either do it
that way or don't do it at all.

The obvious ! workaround is better than a new -leq would be.

Makes sense.

After all, the purpose of adding '>=' and '<=' is to unify and they

are not very useful by themselves. Adding -lgt or -sgt makes things

too complicated.

I don't, however, see the incompatibilities as a big problem, although

it would probably be necessary to have some means of disabling the

feature (a switch, POSIXLY_CORRECT &c).

But I don't think it's suitable to only use POSIXLY_CORRECT to turn
this extension on or off.  This extension seems to be incompatible with
many scripts, even those with GNU extensions enabled.


Maybe we need to add a new option for this extension?  The incompatibilities
is _really_ a problem.  I think it's better not to add it now.

--
Ruiyang Peng



reply via email to

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