help-bash
[Top][All Lists]
Advanced

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

Re: >= and <= for string comparison


From: Lawrence Velázquez
Subject: Re: >= and <= for string comparison
Date: Wed, 18 Jan 2023 04:19:35 -0500
User-agent: Cyrus-JMAP/3.7.0-alpha0-1187-g678636ba0d-fm-20230113.001-g678636ba

On Wed, Jan 18, 2023, at 3:36 AM, Koichi Murase 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. I'm currently not sure if it's worth it. We need
> more real use cases.

And remember that, as Kerin pointed out at the beginning of this
thread, [[ ! x > y ]] and [[ ! x < y ]] are already available.
(They're decently portable, too.  The > and < operators are supported
by many test(1) implementations and will even be in the next version
of POSIX.)  So the threshold for introducing backward-incompatible
equivalents ought to be high.

-- 
vq



reply via email to

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