On Fri, 8 Jul 2016, Andrew Schulman wrote:
> What's the best (simplest, most efficient, or however) way to compare two
> version strings in fish?  Any better way than writing a custom function?
> 
> For example, I want to test if the current running version of fish is less 
> than
> 2.3.1.  I want to compare $FISH_VERSION to 2.3.1, using the version component
> ordering.
> 
> I looked around for builtins or standard commands for this and I didn't find
> any.

FWIW, I've always used the Debian tooling for this:
  dpkg --compare-versions $FISH_VERSION gt 2.2.b1; and echo Hooray!

Not particularly portable, though.

David Adam
[email protected]

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to