GNU bug report logs - #20745
sort: add options to sort by IPv4/IPv6

Previous Next

Package: coreutils;

Reported by: "Silverman, Jeffrey X. -ND" <Jeffrey.X.Silverman.-ND <at> disney.com>

Date: Fri, 5 Jun 2015 17:32:01 UTC

Severity: wishlist

Full log


Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephane Chazelas <stephane.chazelas <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#20745: I would like to make a request for the sort command
Date: Mon, 8 Jun 2015 12:14:07 +0100
2015-06-08 12:43:32 +0200, Erik Auerswald:
[...]
> > I'm not even sure having a tool just for that specific task
> > would make sense though. Here, it sounds more like a job for a
> > high level language like perl/python... (what if I want to sort
> > on roman numerals now, week day names, astrological signs...)
> 
> Well, IP addresses are often encountered on Internet connected computers.
> ;-)

And roman numerals are common in bibliography processing.

The "sort" command has nothing to do with "IP addresses".

OK, there's already a -M for month sorting (locale dependant)
useful in log sorting. There's already a -h and -V.

Those are still quite generic. But IPv4 and IPv6 addresses are
very specific (and the right sort order not necessarily obvious
(IPv4 vs v6, link-local addresses, different IPv4 notations...))

Maybe there's a way to allow that without having to implement
the specifics in sort.

Like sort key flags to invoke commands:

   sort '-k1,1|ip2hex' '-k2,2n|roman2int' '-k3,3|iconv -t us//TRANSLIT'

For sort to invoke those ip2hex/roman2int/iconv shell
command lines to pre-process the sort keys before sorting.

-- 
Stephane





This bug report was last modified 6 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.