[Top][All Lists]

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

Re: [patch] add sort option for IP addresses

From: Matthew Woehlke
Subject: Re: [patch] add sort option for IP addresses
Date: Mon, 27 Nov 2006 17:16:02 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20061025 Thunderbird/ Mnenhy/

Norbert Kiesel wrote:
I needed to sort some text by IP addresses, and there does not seem to
be a good way to do it. They only trick I found was "-n -t. -k1,1 -k2,2
-k3,3 -k4.4" or so, but that is kind of ugly.  So I hacked together a
patch that adds -I,--ipaddess-sort to sort.  It's still incomplete (no
IPv6, no manual, possibly configure.in checks needed), but I would work
on this if there is a chance that the patch will get added.


A while back, I posted an RFC [1] about adding "recursive numeric sort" and numeric sort with an arbitrary base. Assuming you want:

...etc, then recursive should work, and recursive plus base=16 should work for e.g. MAC addresses (and fully-qualified IPv6 addresses, but not shortened ones e.g. 2001:db8::1428:57ab unless they are all shortened in the same place). The consensus there seemed positive on the coreutils side but less optimistic about my end of copyright assignment. IOW if you want to implement my RFC and can handle assignment, it sounded like it would be accepted (and I would be happy to offer whatever assistance won't get me entangled in copyright problems).

Also, you should work against at minimum the latest stable release (6.6), if not CVS. Working against 5.97 you are likely to run into conflicts.

1: http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00020.html

This message will self destruct in five millennia.

reply via email to

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