Subject: Re: bin/225: sort(1) ignores sorting keys
To: Wolfgang Solfrank <ws@tools.de>
From: None <Mark_Weaver@brown.edu>
List: netbsd-bugs
Date: 04/18/1994 08:59:34
Oops.  I feel stupid.  Please kill my pr.

> I don't know how you get this idea.
> 
> > >How-To-Repeat:
> > mhw ~ % cat > t
> > a a a ab
> > a a a aa
> > mhw ~ % sort +0 -1 t
> > a a a aa
> > a a a ab
> > mhw ~ % cat > t
> > b a a ab
> > a a a ab
> > mhw ~ % sort +1 -2 t
> > a a a ab
> > b a a ab
> 
> That's exactly the documented behavior. This is the way any U*X sort command
> has always behaved.
> 
> After all, the files ARE sorted on the fields you selected.
> Records having the same value in the selected fields are sorted on the entire
> line, as is documented in the man page:
> 
>        Finally, as a last resort when all keys compare equal  (or
>        if  no  ordering options were specified at all), sort com-
>        pares  the  lines  byte  by  byte  in  machine   collating
>        sequence.  The -s option disables this last resort compar-
>        ison, producing a stable sort.

	Mark
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu           | Brown University
PGP Key: finger mhw@cs.brown.edu       | Dept of Computer Science

------------------------------------------------------------------------------