Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jul 1996 00:07:34 +0000 ()
From:      James Raynard <fqueries@jraynard.demon.co.uk>
To:        mike@NetworX.ie
Cc:        questions@freebsd.org
Subject:   Re: Any "sort" experts out there?
Message-ID:  <199607310007.AAA00747@jraynard.demon.co.uk>
In-Reply-To: <ECS9607291335A@NetworX.ie> from "Michael Ryan" at Jul 29, 96 01:03:35 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> When I execute the following command, it produces the output
> as shown below.  Has anybody got any ideas where I'm going
> wrong, or is there a bug in "sort"?
 
You didn't say which version of FreeBSD you're using, but it works
as expected in 2.2-current, so it must be a bug that's been fixed:-

$ uname -r
2.2-CURRENT
$ sort -b +1.2 -1.4 +1.4rn -1.6 sort.tmp
a 23AB482
a 45AB452
a 45ab454
a 54ab423
a 25al234
a 95ie548
a 94ie034
a 13ke524
a 45ke091
a 15lX543
a 54lx345
a 43ow845
a 94ow084

[where sort.tmp is the same as your input data.  Exactly the same 
results are obtained by 'sort +1.3 -1.5 +1.5rn -1.7 sort.tmp]

> $ sort -b +1.2 -1.4 +1.4rn -1.6 << EOH
> a 54ab423
> a 13ke524
> a 25al234
> a 43ow845
> a 45AB452
> a 95ie548
> a 15lX543
> a 54lx345
> a 45ab454
> a 94ow084
> a 23AB482
> a 94ie034
> a 45ke091
> EOH
> a 23AB482
> a 45AB452
> a 45ab454
> a 54ab423
> a 25al234
> a 94ie034	<== this line and the next are in the
> a 95ie548	<== wrong order (on 2nd sort field)
> a 13ke524
> a 45ke091
> a 15lX543
> a 54lx345
> a 43ow845
> a 94ow084




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607310007.AAA00747>