bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort by version number (patch included)


From: Padraig Brady
Subject: Re: Sort by version number (patch included)
Date: Wed, 02 Nov 2005 09:17:15 +0000
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

Ian Dall wrote:

I needed to sort by version number so that 1.2.12 > 1.2.3

This is pretty trivial as there is a function strverscmp() in libc,
and I have prepared a patch, including documentation and Changelog
Entries.

Ian

doc/Changelog:

2005-11-02  Ian Dall  <address@hidden>

        * coreutils.texi (sort invocation): Document new option
        --version-sort (-v).

Thanks.
I agree that this would be very useful.
Please compare to the existing functionality in ls though.
I prefer the more general mechanism of a --sort= parameter
as I can see many other possible methods (like random for e.g.).

For reference here is what ls does:

$ ls -1
file1-1.23.tar.gz
file1-1.4.tar.gz
file2-1.4-12.tar.gz
file2-1.4-1.tar.gz
file2-1.4-2.tar.gz
file2-1.4.tar.gz

$ ls -1 --sort=version
file1-1.4.tar.gz
file1-1.23.tar.gz
file2-1.4-1.tar.gz
file2-1.4-2.tar.gz
file2-1.4-12.tar.gz
file2-1.4.tar.gz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]