[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: >= and <= for string comparison
From: |
Koichi Murase |
Subject: |
Re: >= and <= for string comparison |
Date: |
Wed, 18 Jan 2023 17:36:46 +0900 |
2023年1月18日(水) 9:59 Ruiyang Peng <rain@ryp.intirain.cc>:
> It seems that bash's lexical is not so easy to change, so how about using
>
> -eq, -gt, -lt etc like arithmetic? I think this might be a good solution.
As Lawrence has already pointed out, these operators are already used
for the arithmetic comparisons in [[ ... ]], but we could add
lexicographical operators with different names as, e.g., -leq, -lgt,
-llt, -lge, -lle. That would be another possible solution.
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.
--
Koichi
- Re: >= and <= for string comparison, (continued)
- Re: >= and <= for string comparison, Ruiyang Peng, 2023/01/17
- Re: >= and <= for string comparison, Koichi Murase, 2023/01/17
- Re: >= and <= for string comparison, Ruiyang Peng, 2023/01/17
- Re: >= and <= for string comparison, Lawrence Velázquez, 2023/01/18
- Re: >= and <= for string comparison, alex xmb ratchev, 2023/01/18
- Re: >= and <= for string comparison, Lawrence Velázquez, 2023/01/18
- Re: >= and <= for string comparison, alex xmb ratchev, 2023/01/18
- Re: >= and <= for string comparison, Koichi Murase, 2023/01/18
- Re: >= and <= for string comparison, alex xmb ratchev, 2023/01/18
- Re: >= and <= for string comparison, Ruiyang Peng, 2023/01/18
- Re: >= and <= for string comparison,
Koichi Murase <=
- Re: >= and <= for string comparison, Ruiyang Peng, 2023/01/18
- Re: >= and <= for string comparison, Ruiyang Peng, 2023/01/18
- Re: >= and <= for string comparison, Tapani Tarvainen, 2023/01/18
- Re: >= and <= for string comparison, Ruiyang Peng, 2023/01/18
- Re: >= and <= for string comparison, Lawrence Velázquez, 2023/01/18
- Re: >= and <= for string comparison, Peng Yu, 2023/01/18
- Re: >= and <= for string comparison, Emanuele Torre, 2023/01/18
- Re: >= and <= for string comparison, Greg Wooledge, 2023/01/18
- Re: >= and <= for string comparison, alex xmb ratchev, 2023/01/18
- Re: >= and <= for string comparison, Peng Yu, 2023/01/18