help-bash
[Top][All Lists]
Advanced

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

Re: >= and <= for string comparison


From: alex xmb ratchev
Subject: Re: >= and <= for string comparison
Date: Wed, 18 Jan 2023 17:25:56 +0100

On Wed, Jan 18, 2023, 4:01 PM Greg Wooledge <greg@wooledge.org> wrote:

> On Wed, Jan 18, 2023 at 03:54:02PM +0100, Emanuele Torre wrote:
> > That would be wrong; [[ x < y || x = "y" ]]  and  [[ x > y || x = "y" ]]
> > would be correct.
>
> Am I the only person wondering when you would ever need this in a bash
> script?  What's the goal here -- writing your own Bubble Sort from
>
personal achievements , advanced progress .. normal

> scratch in one of the worst imaginable languages for it?  Even when
> writing a comparison function for a sort routine, you only want the
> swaps to happen when the strings are unequal -- never when they're equal,
> since that would just be a waste of time.
>
> Of course, given who the OP is, I know better than to ask "WAYTTD".  I'd
> never, EVER get an answer from them.
>
> But maybe someone else can think of a use case.
>
>


reply via email to

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