From owner-freebsd-questions@FreeBSD.ORG Mon Oct 3 12:37:14 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C3071065672 for ; Mon, 3 Oct 2011 12:37:14 +0000 (UTC) (envelope-from j.mckeown@ru.ac.za) Received: from mail.ru.ac.za (mail.ru.ac.za [IPv6:2001:4200:1010:0:250:56ff:fe8d:5]) by mx1.freebsd.org (Postfix) with ESMTP id 2853C8FC1B for ; Mon, 3 Oct 2011 12:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ru.ac.za; s=ru-msa; h=X-Authenticated-User:Message-Id:Content-Type:MIME-Version:Date:Subject:To:From; bh=cSK5UC6sEVJIdO0aKizpeSqdszScd6cnvte7jVPJFYs=; b=A6BvwmY/qAIWxjYeDZjkcguo3B60+3qHriEqvxxwVrAC2d5G7ELYYXx5ctzoWgs32AU4Vn52JPPaCK+iC7ZSOCKBDs/JKlXS9FcjcTj+ASx+3s3PlzHjUEkZzi+3nOcP; Received: from vorkosigan.ru.ac.za ([2001:4200:1010:1058:219:d1ff:fe9f:a932]:56147) by mail.ru.ac.za with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RAhld-000OXN-Mk for freebsd-questions@freebsd.org; Mon, 03 Oct 2011 14:37:09 +0200 From: Jonathan McKeown Organization: Rhodes University To: freebsd-questions@freebsd.org Date: Mon, 3 Oct 2011 14:37:09 +0200 User-Agent: KMail/1.9.10 References: <20111003120542.GA98919@mech-cluster241.men.bris.ac.uk> In-Reply-To: <20111003120542.GA98919@mech-cluster241.men.bris.ac.uk> X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?utf-8?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l=3B=7E!4?= =?utf-8?q?2HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?utf-8?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Virus-Scanned: mail.ru.ac.za (2001:4200:1010:0:250:56ff:fe8d:5) X-Authenticated-User: s0900137 from vorkosigan.ru.ac.za (2001:4200:1010:1058:219:d1ff:fe9f:a932) using auth_plaintext Subject: Re: cat sort(1) sort floating point numbers? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2011 12:37:14 -0000 On Monday 03 October 2011 14:05:42 Anton Shterenlikht wrote: > I tried sorting a file with a column of floating > point numbers (below) with sort(1) -n. However, > the numbers seem to have been sorted by the first > digit only. sort -g Due to the GNU project's obsession with info (), you= =20 can't readily find this out from the manpage - but the info documentation=20 available on the web for coreutils describes the difference between -g=20 and -n: [when using -n] Neither a leading =E2=80=98+=E2=80=99 nor exponential notat= ion is recognized.=20 To compare such strings numerically, use the --general-numeric-sort (-g)=20 option. Jonathan