> Ah, but does this work for an arbitrary number of subdomains?
> That's the
> tricky one. I know that my solution is cumbersome. I'd like
> to see one that
> handles an arbitrary number of subdomains, but is cleaner
> than mine. I know
> it can be done.
>
Ok... Try this one for up to 4 subdomains where t1 is the unsorted file
awk -F. '{if (NF==1) x = "...."; if (NF==2) x = "..."; \
if (NF==3) x = ".."; if (NF==4) x = "."; \
if (NF==5) x = ""; print x $0}' t1 \
| sort -f. -k 5,5 -k 4,4 -k 3,3 -k 2,2
___________________
Nolug mailing list
nolug@nolug.org
Received on 06/19/03
This archive was generated by hypermail 2.2.0 : 12/19/08 EST