scripting fun

Mike Bird mgb-ubuntu at yosemite.net
Thu Jun 5 22:11:53 UTC 2008


On Thu June 5 2008 14:30:32 Cameron Hutchison wrote:
> Mike Bird <mgb-ubuntu at yosemite.net> writes:
> >(3) For uniq IPs we need "sort -n | uniq" rather than "sort -nu".
>
> Why? sort -n seems wrong in the first place since while IP addresses
> have numeric components, they are not numeric themselves.
>
> Furthermore, I expect sorting numerically will not work with join(1)
> or comm(1) since they would expect lexographic sorting.
>
> It seems to me a simpler "sort -u" should do the trick.

You are correct, Cameron.

It's often easier to diagnose problems in this kind of
script with sorted IPs, but I had forgotten the join.

Thanks,

--Mike Bird




More information about the ubuntu-users mailing list