[PLUG] Sort numbers in 'natural' order
Atom Powers
atom.powers at gmail.com
Sun May 31 17:32:43 UTC 2015
And the solution I'm aware of its too convert the dotted-quad to hex, sort
it, and then convert it back. Or just use a programming library (perl,
ruby, python, etc.) to do the sorting for you.
On Sun, May 31, 2015, 10:29 Atom Powers <atom.powers at gmail.com> wrote:
> I think this means sort sees the dot and assumes it is a string, which
> doesn't sort numerically.
>
> On Sun, May 31, 2015, 10:26 Rich Shepard <rshepard at appl-ecosys.com> wrote:
>
>> Thought I found the correct option for sorting CIDR IP addresses, but
>> apparently haven't.
>>
>> Using -g (general sort), -h (human readable sort), and -n (numeric
>> sort)
>> all leave xxx.11 following xxx.100. I thought one of these would put them
>> in
>> the same order as would us carbon forms.
>>
>> Is there such an option to sort that I've missed?
>>
>> Rich
>> _______________________________________________
>> PLUG mailing list
>> PLUG at lists.pdxlinux.org
>> http://lists.pdxlinux.org/mailman/listinfo/plug
>>
>
More information about the PLUG
mailing list