Re: [Fish-users] comparing strings in fish

2017-09-04 Thread Kurtis Rader
On Mon, Sep 4, 2017 at 8:27 AM, Greg Reagle wrote: > On Mon, Sep 4, 2017, at 11:04, Kurtis Rader wrote: > > Beware `expr`s automatic coercion of strings to ints. If you do `expr > '234 < 1234' you'll > > get false despite "234" being lexically greater than "1234". Which may > be what you want but

Re: [Fish-users] comparing strings in fish

2017-09-04 Thread Greg Reagle
On Mon, Sep 4, 2017, at 11:04, Kurtis Rader wrote: > Beware `expr`s automatic coercion of strings to ints. If you do `expr '234 < > 1234' you'll > get false despite "234" being lexically greater than "1234". Which may be > what you want but > it's a potential gotcha if you really wanted a string,

[Fish-users] error in man page for test: < and > operators for comparing strings are not part of the standard

2017-09-04 Thread Greg Reagle
When I do a man test I see: <<< test(1) fish test(1) . . . Standards test implements a subset of the IEEE Std 1003.1-2008 (POSIX.1) standard. The following exceptions apply: · The < and > operators for comparing strin

Re: [Fish-users] comparing strings in fish

2017-09-04 Thread Kurtis Rader
On Mon, Sep 4, 2017 at 7:16 AM, Greg Reagle wrote: > On Sun, Sep 3, 2017, at 20:06, Mark Volkmann wrote: > > IIUC, there isn't a command in fish that can be used to compare two > strings to see if one is greater than the other in sorting order. For > example, this doesn't work: > > > > set v1 'fo

Re: [Fish-users] comparing strings in fish

2017-09-04 Thread Greg Reagle
On Sun, Sep 3, 2017, at 20:06, Mark Volkmann wrote: > IIUC, there isn't a command in fish that can be used to compare two strings > to see if one is greater than the other in sorting order. For example, this > doesn't work: > > set v1 'foo'; > set v2 'bar'; > if test $v1 > $v2 >   ... > end > >