[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort ignoring human readable suffixes
From: |
Paul Eggert |
Subject: |
Re: sort ignoring human readable suffixes |
Date: |
Wed, 05 May 2004 11:31:25 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Lucas Nussbaum <address@hidden> writes:
> Is there a reason why this is not implemented ?
Lack of time, basically.
> If not, I'll try to submit a patch adding a -h option, available
> only with -n.
Thanks. Here are some thoughts.
Beware the decimal-point character: it's locale-dependent.
Handle both decimal and binary powers of 2, by looking for suffixes
like "GB" (decimal) versus "G" not immediately followed by "B"
(binary).
It's tempting to use strtod but I suspect it won't work in general
(due to the possibility of misconstruing an 'E' suffix, for exabytes)
and anyway it'd be faster to avoid floating-point, just as "sort -n"
does.
'h' should be attachable to each sort key, much as 'n' is.
Finally, will you support -gh as well as -nh? It's probably not worth
the hassle but I thought I'd mention the issue.