Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jul 1996 13:03:35 BST
From:      Michael Ryan <mike@NetworX.ie>
To:        FreeBSD Support <questions@freebsd.org>
Subject:   Any "sort" experts out there?
Message-ID:  <ECS9607291335A@NetworX.ie>

next 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"?

I want to sort in ascending ASCII order on the 3rd and 4th
chars of field2 and then in reverse numeric order on the
5th and 5th chars of field2.

It works if I omitt the -b flag and instead use the command:
$ sort +1.3 -1.5 +1.5rn -1.7
but this isn't what I want.


$ 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


Thanks,
Mike
<mike@NetworX.ie>
---






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