[conspire] Puzzle: How do you sort IP address lists?

Rick Moen rick at linuxmafia.com
Tue Nov 7 14:39:02 PST 2006


Quoting Don Marti (dmarti at zgp.org):

> Alternate approach: 
> 
> tr '.' ' ' < address_list | xargs printf '%03d.%03d.%03d.%03d\n' \
> | sort -u | sed -re 's/\b0+//g' ) < address_list
                                  ^

Works, after you lose the errant parenthesis.  I like it; it's a little 
messy but logical.





More information about the conspire mailing list