From owner-freebsd-stable@FreeBSD.ORG Wed Feb 10 21:00:13 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C27ED1065694 for ; Wed, 10 Feb 2010 21:00:13 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id 8069E8FC16 for ; Wed, 10 Feb 2010 21:00:13 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o1AL08s0087835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Feb 2010 15:00:08 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.3) with ESMTP id o1AL08Ib019365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Feb 2010 15:00:08 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o1AL0776019363; Wed, 10 Feb 2010 15:00:07 -0600 (CST) (envelope-from dan) Date: Wed, 10 Feb 2010 15:00:07 -0600 From: Dan Nelson To: Ruslan Ermilov , stable@freebsd.org Message-ID: <20100210210007.GB9318@dan.emsphone.com> References: <20100210085814.GE9748@acme.spoerlein.net> <20100210104904.GA85373@edoofus.dev.vega.ru> <20100210180535.GG9748@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100210180535.GG9748@acme.spoerlein.net> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.3 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Wed, 10 Feb 2010 15:00:11 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: Subject: Re: numeric sort(1) is broken on -STABLE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 21:00:13 -0000 In the last episode (Feb 10), Ulrich Spörlein said: > On Wed, 10.02.2010 at 13:49:05 +0300, Ruslan Ermilov wrote: > > On Wed, Feb 10, 2010 at 09:58:14AM +0100, Ulrich Spörlein wrote: > > > not sure if this is a pilot error, but it seems to me that gnu sort -n > > > is broken on at least -STABLE (couldn't test -CURRENT yet). > > > > > > It somehow does not manifest when using a simple list and sorting on a > > > specific column, but it always happens to me when using it in > > > combination with find(1). > > > > > > % truncate -s10m a; truncate -s5m b; truncate -s800k c > > > % find a b c -ls|sort -nk7,7 > > > 8 64 -rw-r--r-- 1 uqs wheel 10485760 Feb 10 09:13 a > > > 10 64 -rw-r--r-- 1 uqs wheel 5242880 Feb 10 09:13 b > > > 12 64 -rw-r--r-- 1 uqs wheel 819200 Feb 10 09:13 c > > > > I bet you're using some non-C locale for LC_NUMERIC. What does "locale" > > output tell you? > > Yes and no. LC_NUMERIC is still at C, LC_CTYPE is set to UTF-8, but as > there are no non-ASCII symbols in that output it shouldn't matter, right? > For me, 819200 is smaller than 10485760 in pretty much all locales. Why > the hell is a numeric gnusort locale dependant? Why is -g working anyway? Try adding a 'b' to your sort flags. I bet the leading spaces in front of your numbers are being treated as part of the sort key. Maybe de_DE.UTF-8 and C have different ideas of what is whitespace? -- Dan Nelson dnelson@allantgroup.com