[Top][All Lists]

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

Re: Support in sort for human-readable numbers

From: Matthew Woehlke
Subject: Re: Support in sort for human-readable numbers
Date: Tue, 13 Jan 2009 17:42:22 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090105 Fedora/ Thunderbird/ Mnenhy/

Vitali Lovich wrote:
Perhaps - but for sort, at least from my thinking of how I would
implement this, the additional logic (at least to behave correctly on
all inputs) would be somewhat complicated.  Can you please explain why
you believe this belongs in sort and wouldn't be better served by
pre-processing the text before sort & post-processing it after as

I'd like to point out that, if you're going to require that, you've defeated the purpose of sort understanding human-readable numbers in the first place. If I have to write something more convoluted than 'du -sh * | sort -h', I might as well write 'sdu -s *'. (Which, in fact, I did. 'sdu' is a script that expects normal everything-in-bytes output, does a plain old 'sort -n' on it, and then uses awk to make the sizes human-readable.)

IOW, if you make people format the output anyway, you might as well just forget -h and make the post-formatting be what converts from raw integer sizes to human-friendly sizes. At least, that's my $0.02.

Please do not quote my e-mail address unobfuscated in message bodies.
"So, then, to whom do I have to be Really, Really Nice, to make that official? I have doughnuts." -- Sam Nelson

reply via email to

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