/bin/sort bug

tag at tty3b.UUCP tag at tty3b.UUCP
Thu Sep 1 02:56:31 AEST 1983


*  I don't think that /bin/sort works right.
*  (We are using 4.1bsd /bin/sort, if it makes any difference).
*
*  If I type "sort +0 -1 input >out", I expect the input file to be sorted
*  beginning with the first field and ending before the second field.

This is yet another bug that is really a feature.  or vice-versa...

In any case, it's probably in your documentation.  In the version we're
running (5.0.3) there is a paragraph in the manual for sort(1) which reads:

 >  When there are multiple sort keys, later keys are compared
 >  only after all earlier keys compare equal.  *Lines that
 >  otherwise compare equal are ordered with all bytes
 >  significant.* (Emphasis mine)

In other words: the whole line is used for sorting, you only get to specify
what is of major importance.  We learned this the hard way when trying 
to do multiple sorts on a database.

                        Tom Gloger
                        Teletype Corporation
                        (ihnp4|we13) otuxa!tty3b!tag



More information about the Comp.unix.wizards mailing list