GNU bug report logs -
#5804
sort --human
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5804 in the body.
You can then email your comments to 5804 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Tue, 30 Mar 2010 16:13:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Phil Dumont <phil <at> solidstatescientific.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Tue, 30 Mar 2010 16:13:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
It sure would be nice if the sort command had a --human option:
du -s --human * | sort --human
phil
Reply sent
to
Bob Proulx <bob <at> proulx.com>
:
You have taken responsibility.
(Tue, 30 Mar 2010 17:05:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Phil Dumont <phil <at> solidstatescientific.com>
:
bug acknowledged by developer.
(Tue, 30 Mar 2010 17:05:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 5804-done <at> debbugs.gnu.org (full text, mbox):
Phil Dumont wrote:
> It sure would be nice if the sort command had a --human option:
> du -s --human * | sort --human
Ask and you shall receive. Seek and ye shall find! (Or in this case
if you had searched you would have found it. :-)
Sort has had that option since coreutils release 7.5. Here is the
release announcement.
http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00201.html
* Noteworthy changes in release 7.5 (2009-08-20) [stable]
** New features
sort accepts a new option, --human-numeric-sort (-h): sort numbers
while honoring human readable suffixes like KiB and MB etc.
Meanwhile, coreutils release 8.4 (2010-01-13) is current and stable.
Bob
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Tue, 30 Mar 2010 17:14:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 5804 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 03/30/2010 09:14 AM, Phil Dumont wrote:
> It sure would be nice if the sort command had a --human option:
>
> du -s --human * | sort --human
It does, as of coreutils 7.5. Are you running something older?
--
Eric Blake eblake <at> redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Tue, 30 Mar 2010 17:14:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 5804 <at> debbugs.gnu.org (full text, mbox):
Hi Phil,
Is this what you want?
http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=159faba1376ffd5a46fe4bbc780d85dd3e502cea
On Tue, Mar 30, 2010 at 8:14 AM, Phil Dumont
<phil <at> solidstatescientific.com> wrote:
> It sure would be nice if the sort command had a --human option:
>
> du -s --human * | sort --human
>
> phil
>
>
>
>
>
>
--
Glen Lenker
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Tue, 30 Mar 2010 17:14:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 5804 <at> debbugs.gnu.org (full text, mbox):
sort supports --human-numeric-sort since coreutils 7.5.
Cheers,
Giuseppe
Phil Dumont <phil <at> solidstatescientific.com> writes:
> It sure would be nice if the sort command had a --human option:
>
> du -s --human * | sort --human
>
> phil
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Tue, 30 Mar 2010 17:51:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 5804 <at> debbugs.gnu.org (full text, mbox):
Bob Proulx wrote 704 bytes:
> ** New features
> sort accepts a new option, --human-numeric-sort (-h): sort numbers
> while honoring human readable suffixes like KiB and MB etc.
Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Tue, 30 Mar 2010 23:27:02 GMT)
Full text and
rfc822 format available.
Message #25 received at submit <at> debbugs.gnu.org (full text, mbox):
Michal Svoboda <pht <at> spatium.org> wrote:
> Bob Proulx wrote 704 bytes:
> > ** New features
> > sort accepts a new option, --human-numeric-sort (-h): sort numbers
> > while honoring human readable suffixes like KiB and MB etc.
>
> Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?
$ { echo 1MB; echo 1000KiB; echo 1MiB; } | sort -h
sort: both SI and IEC prefixes present on units
That would be a no to the "sort" part, but perhaps a yes to the
"correctly" part.
$ { echo 1001KiB; echo 1000KiB; echo 1MiB; } | sort -h
1000KiB
1001KiB
1MiB
$ { echo 1001KB; echo 1000KB; echo 1MB; } | sort -h
1000KB
1001KB
1MB
Seems to work fine when you give it just one type of unit to handle.
--
I have a firm grip on reality. Now I can strangle it.
-- Gordon Paynter
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Wed, 31 Mar 2010 16:30:03 GMT)
Full text and
rfc822 format available.
Message #28 received at submit <at> debbugs.gnu.org (full text, mbox):
Drake Wyrm wrote 796 bytes:
> Michal Svoboda <pht <at> spatium.org> wrote:
> > Bob Proulx wrote 704 bytes:
> > > ** New features
> > > sort accepts a new option, --human-numeric-sort (-h): sort numbers
> > > while honoring human readable suffixes like KiB and MB etc.
> >
> > Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?
>
> $ { echo 1MB; echo 1000KiB; echo 1MiB; } | sort -h
> sort: both SI and IEC prefixes present on units
>
> That would be a no to the "sort" part, but perhaps a yes to the
> "correctly" part.
Ah, this is obviously some strange use of the word *correctly* that
I wasn't previously aware of.
Michal Svoboda
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Thu, 01 Apr 2010 06:12:01 GMT)
Full text and
rfc822 format available.
Message #31 received at submit <at> debbugs.gnu.org (full text, mbox):
Michal Svoboda wrote:
> Drake Wyrm wrote 796 bytes:
>> Michal Svoboda <pht <at> spatium.org> wrote:
>> > Bob Proulx wrote 704 bytes:
>> > > ** New features
>> > > sort accepts a new option, --human-numeric-sort (-h): sort numbers
>> > > while honoring human readable suffixes like KiB and MB etc.
>> >
>> > Interesting. So does it sort correctly 1 MB < 1000 KiB < 1 MiB ?
>>
>> $ { echo 1MB; echo 1000KiB; echo 1MiB; } | sort -h
>> sort: both SI and IEC prefixes present on units
>>
>> That would be a no to the "sort" part, but perhaps a yes to the
>> "correctly" part.
>
> Ah, this is obviously some strange use of the word *correctly* that
> I wasn't previously aware of.
;-)
Perhaps he meant that it works as documented:
`-h'
`--human-numeric-sort'
`--sort=human-numeric'
Sort numerically, as per the `--numeric-sort' option below, and in
addition handle IEC or SI suffixes like MiB, MB etc (*note Block
size::). Note a mixture of IEC and SI suffixes is not supported
and will be flagged as an error. Also the numbers must be
abbreviated uniformly. I.E. values with different precisions like
6000K and 5M will be sorted incorrectly.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#5804
; Package
coreutils
.
(Thu, 01 Apr 2010 17:33:01 GMT)
Full text and
rfc822 format available.
Message #34 received at submit <at> debbugs.gnu.org (full text, mbox):
Jim Meyering wrote 1206 bytes:
> ;-)
> Perhaps he meant that it works as documented:
>
> `-h'
> `--human-numeric-sort'
> `--sort=human-numeric'
> Sort numerically, as per the `--numeric-sort' option below, and in
> addition handle IEC or SI suffixes like MiB, MB etc (*note Block
> size::). Note a mixture of IEC and SI suffixes is not supported
> and will be flagged as an error. Also the numbers must be
> abbreviated uniformly. I.E. values with different precisions like
> 6000K and 5M will be sorted incorrectly.
I see, I wasn't aware of the "Note". In that case, it is suitably
described as "this will sort whatever the other coreutils give you when
you use -h".
Michal Svoboda
Severity set to 'wishlist' from 'normal'
Request was from
Bob Proulx <bob <at> proulx.com>
to
control <at> debbugs.gnu.org
.
(Sat, 03 Apr 2010 20:04:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 02 May 2010 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.