In the last episode (Apr 22), JJB said:
> How to specify the  fields the sort program is to sort on?
> 
> My file has blanks between the fields and I want to sort on
> field number 9 which is ip address.
> 
> I want to sort filea and put results in fileb.
> 
> A sample of the sort command  to be used from the command line would
> go an long way to understanding how to use it.

Somthing like "sort -k 9bn < filea > fileb" should work, but it will
end up sorting only the first octect.  If you can get your addresses to
be 0-padded (000.000.000.000), you can drop the 'n' from the sort
command and just do a plain ascii sort.

-- 
        Dan Nelson
        [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to