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.