I need to find sort's version when the -V flag was introduced. But I am finding myself some hard time finding the changelog for this command. Where can I view it?


If you mean the version of sort which is part of the GNU coreutils, you can find its changelog in any source tarball (available here).

  • I don't seem to find what I need. Perhaps I am not looking in the right place, but can you guide me a bit? – linkyndy May 22 '14 at 9:52
  • I can't find anything in the changelog either. However, the -V flag wasn't there in version 5.92, so it was introduced some time after that. Worst case, download the tarballs sequentially and check the man page for sort (man man/sort.1) until you see -V. – fkraiem May 22 '14 at 10:09
  • Yes, that's the version I have and does not have the flag. But I need something to be sure, as I need to check sort's version and conditionally add the -V flag to it. Shouldn't there exist some kind of command changelog or something? – linkyndy May 22 '14 at 11:19
  • 1
    If you want to know whether a particular implementation of sort has the -V flag, just try to run sort with it and see whether or not it fails. This will be more reliable than relying on version numbers, since version numbers will fail on non-GNU implémentations. – fkraiem May 22 '14 at 11:45
  • Alright...will do this then :) – linkyndy May 22 '14 at 11:46

Best way:

sort -V /dev/null || { echo 'drats' >&2; exit 1; }

For the record, coreutils sort v7.0 (2008-10-05) has the required functionality: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob_plain;f=NEWS;hb=HEAD

  • This command returns nothing on my machine (Debian wheezy). – Faheem Mitha May 23 '14 at 8:11
  • Nothing for me also... – linkyndy May 23 '14 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.