Funny sort

John P. Linderman jpl at eagle.UUCP
Sun Jul 10 00:37:21 AEST 1983


I had trouble with mail, so I'm posting this to the net.

The problem with   sort -t:  is that it specifies a field separator,
but specifies no fields.  Sort just reverts to its default of using
the entire line.  The effect you are probably after can be obtained by

sort -t: +0 -1 +1 -2 ...

One might argue that that would make a good default when a -t is
given but no fields are mentioned.  Peeking into how sort works
reveals that it isn't is easy as one would hope, so the moral is,
if you use -t, specify some fields.

John P. Linderman  eagle!jpl  Department of Total Disorder



More information about the Comp.bugs.4bsd.ucb-fixes mailing list