From owner-freebsd-questions Tue Jul 30 17:10:12 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA19459 for questions-outgoing; Tue, 30 Jul 1996 17:10:12 -0700 (PDT) Received: from jraynard.demon.co.uk (jraynard.demon.co.uk [158.152.42.77]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA19451 for ; Tue, 30 Jul 1996 17:10:06 -0700 (PDT) Received: (from fqueries@localhost) by jraynard.demon.co.uk (8.7.5/8.6.12) id AAA00747; Wed, 31 Jul 1996 00:07:34 GMT From: James Raynard Message-Id: <199607310007.AAA00747@jraynard.demon.co.uk> Subject: Re: Any "sort" experts out there? To: mike@NetworX.ie Date: Wed, 31 Jul 1996 00:07:34 +0000 () Cc: questions@freebsd.org In-Reply-To: from "Michael Ryan" at Jul 29, 96 01:03:35 pm X-Mailer: ELM [version 2.4 PL24 ME8a] Content-Type: text Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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