~/bin/path-version -latest -verbose --version -print -exec bash -c 'echo hi from bash $($SHELL -version)'
latest: /home/glew/bin/bash: 3.2.25(1)-release
exec /home/glew/bin/bash, -c echo hi from bash $($SHELL -version);
hello /bin/bash -c echo hi from bash $($SHELL -version)
hi from bash GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc.
I was surprised not to find such a library already existing. Some were close, but not quite there.
Also compares. Although the comparison rules are a it two simplistic: strings are lexically sorted, whereas possibly
1.2rc should be less recent than 1.2, if the latter is what actually got released.