From owner-freebsd-arch Thu Nov 29 8:48: 2 2001 Delivered-To: freebsd-arch@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id ACC5937B41A; Thu, 29 Nov 2001 08:47:33 -0800 (PST) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.4/8.11.1) with ESMTP id fATGlXK61006; Thu, 29 Nov 2001 11:47:33 -0500 (EST) (envelope-from green@green.bikeshed.org) Message-Id: <200111291647.fATGlXK61006@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: "Andrey A. Chernov" Cc: "David O'Brien" , "Brian F. Feldman" , Mark Murray , Sheldon Hearn , arch@FreeBSD.ORG Subject: Re: BSD sort vs GNU sort. In-Reply-To: Your message of "Thu, 29 Nov 2001 19:27:52 +0300." <20011129162751.GD8233@nagual.pp.ru> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Nov 2001 11:47:33 -0500 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Andrey A. Chernov" wrote: > On Thu, Nov 29, 2001 at 08:19:01 -0800, David O'Brien wrote: > > On Thu, Nov 29, 2001 at 07:13:23PM +0300, Andrey A. Chernov wrote: > > > If you want sufficient test for single-byte sorting & collation, tr= y to > > > use ru_RU.KOI8-R encoding. > > = > > I am not sure most of us could do that well. Can you test BSD sort a= nd > > report back? > = > I don't have it in hand. = > = > The test is simple: > = > 1) Create the file with single character per line from \000 to \377 > = > 2) Sort it using = > LC_CTYPE=3Dru_RU.KOI8-R gnu_sort < file > (I mean _patched_ GNU sort we currently have in sources, not original = > one which not support collation) > = > 3) Sort it using = > LC_CTYPE=3Dru_RU.KOI8-R bsd_sort < file > = > 4) Compare results. {"/home/green/netbsd-sort/basesrc/usr.bin/sort"}$ ruby File.open('f', 'w') {|f| 1.upto(255) {|n| f.puts(n.chr) if n.chr !~ /^[[:cntrl:]]/ } } {"/home/green/netbsd-sort/basesrc/usr.bin/sort"}$ ls -l f -rw-r--r-- 1 green green 446 29 =CE=CF=D1 11:46 f {"/home/green/netbsd-sort/basesrc/usr.bin/sort"}$ md5 f MD5 (f) =3D 60369ee3857999b452c560c7a8256734 {"/home/green/netbsd-sort/basesrc/usr.bin/sort"}$ sort f | md5 3c31168a9159c2df8d8ce56370579c58 {"/home/green/netbsd-sort/basesrc/usr.bin/sort"}$ ./sort f | md5 60369ee3857999b452c560c7a8256734 -- = Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message