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,

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 > >

Re: [Fish-users] comparing strings in fish

2017-09-03 Thread Kurtis Rader
On Sun, Sep 3, 2017 at 5:06 PM, 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 > >

[Fish-users] comparing strings in fish

2017-09-03 Thread Mark Volkmann
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 Is there a recommended workaround for this? -- R. Mark Volkmann Object Co