[Shell Script] Sort IP Addresses

| | Comments (0)

# cat host
140.117.1.77
140.117.11.7
140.1.99.1
# sort host
140.117.11.7
140.117.1.77
140.1.99.1
# sort -t. -nk1,1 -k2,2 -k3,3 -k4,4 host
140.1.99.1
140.117.1.77
140.117.11.7

Leave a comment

April 2008

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

About this Entry

This page contains a single entry by Pank published on March 16, 2007 4:18 PM.

Lingoes was the previous entry in this blog.

mtop - MySQL top is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.