[Top][All Lists]

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

Re: RFC: add'l 'sort -n' options

From: Matthew Woehlke
Subject: Re: RFC: add'l 'sort -n' options
Date: Mon, 06 Nov 2006 10:34:45 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060909 Thunderbird/ Mnenhy/

Paul Eggert wrote:
Matthew Woehlke writes:
'-N _options_, --numeric-sort=_options_'

The other sort options can be attached to -k; how would this work here?

Sorry, I'm not sure I understand what you mean by this comment. What would be attached to -k, and how?

'a': convert numbers with strtol(,0) (i.e. automatically recognize
'0x<num>' (hex), '0<num>' (octal).
'o': all numbers are octal, i.e. strtol(,8)
'x': all numbers are hexadecimal, i.e. strtol(,16)

These shouldn't use strtol; they should work regardless of the size
of the number, just as it already works for decimal numbers.

I was actually wondering about that... from the info page it sounded like strtod is actually used, but of course there is no reason why we would need to use strtol (as opposed to writing our own, as you seem to be implying). In fact, I too would probably prefer the latter. (I guess this means you would always convert numbers to [long] doubles?)

...and in light of 'o', 'x', perhaps '-B <num>, --numeric-base <num>'
would be in order?

Yes, perhaps.

Hmm, or maybe just -B0 would be equivalent to 'a' (like strtol), which would just leave 'r', 'h' and 'd'.

So... do you think these would be good ideas? I.e. if I submitted a patch, it would get considered? I am probably most interested in the human-readable options, especially in light of the comments w.r.t. du posted a few weeks back.

If this message is intercepted, the sender will disavow all knowledge of its existence.

reply via email to

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