|
From: | Ruiyang Peng |
Subject: | Re: >= and <= for string comparison |
Date: | Wed, 18 Jan 2023 16:39:20 +0800 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Thunderbird/109.0 |
在 2023/1/18 16:11, Lawrence Velázquez 写道:
On Tue, Jan 17, 2023, at 7:59 PM, Ruiyang Peng wrote:It seems that bash's lexical is not so easy to change, so how about using -eq, -gt, -lt etc like arithmetic?Huh? Those operators are already defined to perform arithmetic comparisons. How could they be used for lexicographic comparisons too?
So if it's not possible to support arithmetic comparison and string comparison at the same time, how about adding a prefix "s" representing "string" to distinguish? -seq, -sgt, -slt, etc, though a bit weird. -- Ruiyang Peng
[Prev in Thread] | Current Thread | [Next in Thread] |