RE: [Nolug] Sorting lists of domains

From: Dustin Puryear <dpuryear_at_usa.net>
Date: Thu, 19 Jun 2003 17:44:56 -0500
Message-Id: <5.1.0.14.0.20030619174347.032e34f0@pop.netaddress.com>

At 02:42 PM 6/19/2003 -0500, you wrote:
>Don't know if it's cleaner or not - but this handles as many subdomains as
>you throw at it.
>
>awk -F. '{dom="";for(i=NF;i>0;i=i-1){dom = dom "." $i;};print dom;}'
>test.sort | sort | awk -F. '{dom="";for(i=NF;i>0;i=i-1){dom = dom "."
>$i;};print substr(dom,2,length(dom)-2);}'
>
>All one line of course.
>
>Produces this:
>1.a.com
>5.a.com

I think we have a winner then.

---
Dustin Puryear <dustin@puryear-it.com>
Puryear Information Technology
Windows, UNIX, and IT Consulting
http://www.puryear-it.com
___________________
Nolug mailing list
nolug@nolug.org
Received on 06/19/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST