[conspire] sort -t.

Tom Macke macke at scripps.edu
Tue Nov 7 12:33:23 PST 2006


Use -t. to break the lines into fields on ., then sort 4 ints from
left to right:

	sort -t. +0n -1 +1n -2 +2n -3 +3n -4 <ip.list > ip.list.sort

Input:

10.123.189.105
12.149.177.21
12.154.4.213
12.159.232.66
12.205.7.190
12.206.142.76
12.214.50.126
12.221.163.162
12.30.72.162
4.3.76.194
8.10.33.176

Output:

4.3.76.194
8.10.33.176
10.123.189.105
12.30.72.162
12.149.177.21
12.154.4.213
12.159.232.66
12.205.7.190
12.206.142.76
12.214.50.126
12.221.163.162

cheers,
tom






More information about the conspire mailing list