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.39

Regards,
- Robert

On Fri, May 13, 2016 at 5:53 AM, Rich Shepard <[email protected]> wrote:
>    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.
>
>    Thought I had this figured out once before, but either I'm not now
> sufficiently cafinated or I'm not seeing the proper option(s).
>
> Rich
>
>
>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to