From owner-freebsd-questions Mon Jul 29 05:12:30 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id FAA22601 for questions-outgoing; Mon, 29 Jul 1996 05:12:30 -0700 (PDT) Received: from sam.networx.ie (dublin-ts4-115.indigo.ie [194.125.133.115]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id FAA22596 for ; Mon, 29 Jul 1996 05:12:26 -0700 (PDT) Received: from mip1.networx.ie (mip1.networx.ie [194.9.12.1]) by sam.networx.ie (8.6.12/8.6.12) with SMTP id NAA04481 for ; Mon, 29 Jul 1996 13:12:06 +0100 X-Organisation: I.T. NetworX Ltd X-Business: Network Consultancy and Training X-Address: 67 Merrion Square, Dublin 2, Ireland X-Voice: +353-1-676-8866 X-Fax: +353-1-676-8868 Received: from mike.networx.ie by mip1.networx.ie Date: Mon, 29 Jul 1996 13:03:35 BST From: Michael Ryan Reply-To: mike@NetworX.ie Subject: Any "sort" experts out there? To: FreeBSD Support Message-Id: Priority: Normal Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII 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"? 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 ---