Re: [PLUG] Sorting CIDR Addresses

2016-05-13 Thread Rich Shepard
On Fri, 13 May 2016, Paul Heinlein wrote: > You might try "ls -V" which often works well with IPv4 addresses. Paul, I found your web page explaing sorting IP addresses and bookmarked it. Tried -V; perhaps I mis-read the results and thought it didn't work for me. Thanks, Rich __

Re: [PLUG] Sorting CIDR Addresses

2016-05-13 Thread Paul Heinlein
On Fri, 13 May 2016, Rich Shepard wrote: > On Fri, 13 May 2016, Robert Citek wrote: > >> Is this what you are looking for? > > Robert, > > Yes. > >> sort -t. -k1,1n -k2,2n -k3,3n -k4,4n > > I forgot that I need to specify the sort order by key for each grouping. You might try "ls -V" which of

Re: [PLUG] Sorting CIDR Addresses

2016-05-13 Thread Rich Shepard
On Fri, 13 May 2016, Robert Citek wrote: > Is this what you are looking for? Robert, Yes. > sort -t. -k1,1n -k2,2n -k3,3n -k4,4n I forgot that I need to specify the sort order by key for each grouping. Thanks very much, Rich ___ PLUG mailing

Re: [PLUG] Sorting CIDR Addresses

2016-05-13 Thread Robert Citek
Is this what you are looking for? $ dig +short www.google.com www.amazon.com www.twitter.com | sort -t. -k1,1n -k2,2n -k3,3n -k4,4n twitter.com. 54.239.26.128 74.125.28.99 74.125.28.103 74.125.28.104 74.125.28.105 74.125.28.106 74.125.28.147 199.59.148.10 199.59.148.82 199.59.149.198 199.59.150.3

[PLUG] Sorting CIDR Addresses

2016-05-13 Thread Rich Shepard
I have a file of CIDR addresses that I want to sort in numeric order but none of the sort options is working for me. I've tried -d, -g, -h, and -n and still find that the second group is sorted digit by digit and not as a 'word.' For example, 66.7 follows 66.60 instead of following 66.6. Tho