From unknown Tue Jun 24 22:35:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23673 <23673@debbugs.gnu.org> To: bug#23673 <23673@debbugs.gnu.org> Subject: Status: wrong sorting order Reply-To: bug#23673 <23673@debbugs.gnu.org> Date: Wed, 25 Jun 2025 05:35:37 +0000 retitle 23673 wrong sorting order reassign 23673 coreutils submitter 23673 alainm severity 23673 normal tag 23673 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 11:32:30 2016 Received: (at submit) by debbugs.gnu.org; 1 Jun 2016 15:32:30 +0000 Received: from localhost ([127.0.0.1]:50015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b888D-0001im-9i for submit@debbugs.gnu.org; Wed, 01 Jun 2016 11:32:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b861L-0003WB-Eb for submit@debbugs.gnu.org; Wed, 01 Jun 2016 09:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b861F-0002gH-4C for submit@debbugs.gnu.org; Wed, 01 Jun 2016 09:17:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b861F-0002g5-1D for submit@debbugs.gnu.org; Wed, 01 Jun 2016 09:17:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b861C-0006n5-Jg for bug-coreutils@gnu.org; Wed, 01 Jun 2016 09:17:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8618-0002fJ-IJ for bug-coreutils@gnu.org; Wed, 01 Jun 2016 09:17:06 -0400 Received: from smtps-n.oca.eu ([192.54.174.167]:36741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8618-0002er-A7 for bug-coreutils@gnu.org; Wed, 01 Jun 2016 09:17:02 -0400 Received: from [192.168.245.26] (openvpn-out1.oca.eu [10.254.1.146]) by smtps-n.oca.eu (Postfix) with ESMTPSA id F1FC680256 for ; Wed, 1 Jun 2016 15:16:57 +0200 (CEST) To: bug-coreutils@gnu.org From: alainm Subject: wrong sorting order Message-ID: <574EE047.20809@oca.eu> Date: Wed, 1 Jun 2016 15:16:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 01 Jun 2016 11:32:28 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hi I need to perform a sort based on the first 3 indexes of a line (sort -k 1,3 -n truc.lst): The 0 coordinates are not placed before the 2 coordinates, it looks like the spaces are ignore: [alainm@tagir 1src]$ more truc.lst 2 9 32 27 1.3925940E-13 0 29 33 33 0.0000000E+00 0 29 33 1 0.0000000E+00 0 29 33 1 0.0000000E+00 0 29 33 1 0.0000000E+00 2 9 32 19 0.0000000E+00 2 9 32 19 0.0000000E+00 2 9 32 27 0.0000000E+00 0 29 33 9 0.0000000E+00 0 29 33 9 0.0000000E+00 0 29 33 9 0.0000000E+00 2 9 32 35 1.4211723E-13 2 9 32 19 1.3592767E-13 0 29 33 1 1.5564060E-13 2 9 32 43 1.4770083E-13 0 29 33 17 0.0000000E+00 0 29 33 17 0.0000000E+00 2 9 32 11 8.4966119E-14 0 29 33 25 0.0000000E+00 2 9 32 3 0.0000000E+00 2 9 32 3 0.0000000E+00 2 9 32 3 0.0000000E+00 2 9 32 3 4.8971061E-14 0 29 33 41 0.0000000E+00 2 9 32 11 0.0000000E+00 2 9 32 11 0.0000000E+00 2 9 32 11 0.0000000E+00 [alainm@tagir 1src]$ sort -k 1,3 -n truc.lst 2 9 32 11 0.0000000E+00 2 9 32 11 0.0000000E+00 2 9 32 11 0.0000000E+00 2 9 32 11 8.4966119E-14 2 9 32 19 0.0000000E+00 2 9 32 19 0.0000000E+00 2 9 32 19 1.3592767E-13 2 9 32 27 0.0000000E+00 2 9 32 27 1.3925940E-13 2 9 32 3 0.0000000E+00 2 9 32 3 0.0000000E+00 2 9 32 3 0.0000000E+00 2 9 32 3 4.8971061E-14 2 9 32 35 1.4211723E-13 2 9 32 43 1.4770083E-13 0 29 33 1 0.0000000E+00 0 29 33 1 0.0000000E+00 0 29 33 1 0.0000000E+00 0 29 33 1 1.5564060E-13 0 29 33 17 0.0000000E+00 0 29 33 17 0.0000000E+00 0 29 33 25 0.0000000E+00 0 29 33 33 0.0000000E+00 0 29 33 41 0.0000000E+00 0 29 33 9 0.0000000E+00 0 29 33 9 0.0000000E+00 0 29 33 9 0.0000000E+00 [alainm@tagir 1src]$ [alainm@tagir 1src]$ sort --version sort (GNU coreutils) 8.4 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Mike Haertel and Paul Eggert. Cheer Alain From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 11:44:56 2016 Received: (at 23673) by debbugs.gnu.org; 1 Jun 2016 15:44:56 +0000 Received: from localhost ([127.0.0.1]:50044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b88KF-00024C-Pb for submit@debbugs.gnu.org; Wed, 01 Jun 2016 11:44:55 -0400 Received: from mail-qg0-f43.google.com ([209.85.192.43]:35893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b88KE-00023z-OC for 23673@debbugs.gnu.org; Wed, 01 Jun 2016 11:44:54 -0400 Received: by mail-qg0-f43.google.com with SMTP id q32so109916873qgq.3 for <23673@debbugs.gnu.org>; Wed, 01 Jun 2016 08:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=mGUTK3O+14dRFN9+QbSRH4nOK+wmVXTdMZnGhDHu3aw=; b=WvCtoGNt01mmsS8C0jg0ou9CINcIZ/twjKQbHxAI0h0cF3nw/6CBuNA4x3tak+/uqb BftjkCwxY2MdLmkt9N4k87Us83M+wnsserYduisu+kYQz8MU8CQ71LLZLRhcGokt0xo9 PNkvORnJuE8zle+e7RBjTIvH4U7KltBpiN/IU2NBO7tv2I8h/QNYHV6UBzBS+vgB1FgT jCjlR4pRGix8lXJEE55FydPIbrCnLKG1bqwZdXHRTPfSZaDF3dp+IA6UUIffwUuRzSOW +PqqXui8jyBvWDfLGIeuTmX/OGm66MuwL0M+YWKoOG9IYtukm8QMyZdffrH5O8PyJCTy v8wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=mGUTK3O+14dRFN9+QbSRH4nOK+wmVXTdMZnGhDHu3aw=; b=dEhF7alwI7EirdDM5b2p2lL8VietWe7yuSEOVOeMiFmM39+zhOgRgosPtZBLtnviVy onM1Ca0w8FmaYh/OXs+8D5KxT6HsLo6B8imsrDrTA6H5GjsN+RRWuhVHaBvi3CRMPR0g 5P6OIsXBplXrYazUnttutVuHFL2ZCWE8c/2eQAeBJfw/SrkixC5G7wlmmZ4HTf8B1B5Z n+9nXOM7Vr9JGMv2dLbYMg/3u2Jvry6Hkaugf1wwQ58o738vVBa2IP8Jjt89ofLoIsx1 fcVjsRAHtRMM3OL7japtSsBfP5SWt7vgGE85FD7V9go6CqYpHVf/ScuXe5wEr4BrU+zS KPWw== X-Gm-Message-State: ALyK8tLOuEb/F/pSy5a2WQmUO6nTf/zBbO5Fjjv2vHuwIUwTv+7cG5X2uFx7IdKVZxWyEw== X-Received: by 10.140.101.23 with SMTP id t23mr21821922qge.57.1464795889314; Wed, 01 Jun 2016 08:44:49 -0700 (PDT) Received: from disco.erlich.nygenome.org ([69.74.14.178]) by smtp.googlemail.com with ESMTPSA id p46sm6542985qgd.10.2016.06.01.08.44.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2016 08:44:48 -0700 (PDT) Subject: Re: bug#23673: wrong sorting order To: alainm , 23673@debbugs.gnu.org References: <574EE047.20809@oca.eu> From: Assaf Gordon Message-ID: <574F02EF.6010209@gmail.com> Date: Wed, 1 Jun 2016 11:44:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <574EE047.20809@oca.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23673 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tag 23673 notabug close 23673 stop Hello Alain, On 06/01/2016 09:16 AM, alainm wrote: > I need to perform a sort based on the first 3 indexes of a line (sort -k 1,3 -n truc.lst): > > The 0 coordinates are not placed before the 2 coordinates, it looks like the spaces are ignore: [...] > > [alainm@tagir 1src]$ sort -k 1,3 -n truc.lst To sort multiple numeric fields, use separate "-k" parameters, like so: sort -k1,1 -k2,2 -k3,3 -n truc.list If in the future you wish to combine different ordering (e.g. numeric and alphanumeric, or some fields in reverse order), consider specifying the order in each key instead of globally: sort -k1n,1 -k2nr,2 -k3n,3 truc.list > [alainm@tagir 1src]$ sort --version > sort (GNU coreutils) 8.4 If you upgrade to coreutils version 8.6 or later, sort will accept '--debug' option, which will help you troubleshoot such cases: $ sort --debug -k 1,3 -n truc.lst sort: using ‘en_US.UTF-8’ sorting rules sort: key 1 is numeric and spans multiple fields [...] I'm marking this bug as done, but discussion can continue by replying to this thread. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 11:56:23 2016 Received: (at 23673) by debbugs.gnu.org; 1 Jun 2016 15:56:23 +0000 Received: from localhost ([127.0.0.1]:50052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b88VK-0003wW-Sv for submit@debbugs.gnu.org; Wed, 01 Jun 2016 11:56:23 -0400 Received: from smtps-n.oca.eu ([192.54.174.167]:59876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b88VJ-0003wI-3e for 23673@debbugs.gnu.org; Wed, 01 Jun 2016 11:56:21 -0400 Received: from [192.168.245.26] (openvpn-out1.oca.eu [10.254.1.146]) by smtps-n.oca.eu (Postfix) with ESMTPSA id 7993B80181 for <23673@debbugs.gnu.org>; Wed, 1 Jun 2016 17:56:14 +0200 (CEST) Subject: Re: bug#23673: wrong sorting order To: 23673@debbugs.gnu.org References: <574EE047.20809@oca.eu> <574F02EF.6010209@gmail.com> From: alainm Message-ID: <574F059E.4070008@oca.eu> Date: Wed, 1 Jun 2016 17:56:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <574F02EF.6010209@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -3.7 (---) X-Debbugs-Envelope-To: 23673 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.7 (---) Thank you Assaf for the clarification. Alain On 01/06/2016 17:44, Assaf Gordon wrote: > tag 23673 notabug > close 23673 > stop > > Hello Alain, > > On 06/01/2016 09:16 AM, alainm wrote: >> I need to perform a sort based on the first 3 indexes of a line (sort >> -k 1,3 -n truc.lst): >> >> The 0 coordinates are not placed before the 2 coordinates, it looks >> like the spaces are ignore: > [...] >> >> [alainm@tagir 1src]$ sort -k 1,3 -n truc.lst > > To sort multiple numeric fields, use separate "-k" parameters, like so: > > sort -k1,1 -k2,2 -k3,3 -n truc.list > > If in the future you wish to combine different ordering (e.g. numeric > and alphanumeric, or some fields in reverse order), > consider specifying the order in each key instead of globally: > > sort -k1n,1 -k2nr,2 -k3n,3 truc.list > >> [alainm@tagir 1src]$ sort --version >> sort (GNU coreutils) 8.4 > > If you upgrade to coreutils version 8.6 or later, sort will accept > '--debug' option, which will help you troubleshoot such cases: > > $ sort --debug -k 1,3 -n truc.lst > sort: using ‘en_US.UTF-8’ sorting rules > sort: key 1 is numeric and spans multiple fields > [...] > > > I'm marking this bug as done, but discussion can continue by replying > to this thread. > > regards, > - assaf > > From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 28 02:03:15 2018 Received: (at control) by debbugs.gnu.org; 28 Oct 2018 06:03:15 +0000 Received: from localhost ([127.0.0.1]:46180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGeAM-0001mL-SP for submit@debbugs.gnu.org; Sun, 28 Oct 2018 02:03:15 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:40752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGeAL-0001jH-NR for control@debbugs.gnu.org; Sun, 28 Oct 2018 02:03:14 -0400 Received: by mail-pf1-f181.google.com with SMTP id g21-v6so2440191pfi.7 for ; Sat, 27 Oct 2018 23:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=zeWGhPb9Uhi362exnAeOjISmIIYDfYSBn1HEwyU2NVE=; b=VVfVMV3kZQ1dAlUSDiHxZGseJgpHNn1WaTuTxEgH4xqZYX7mGFbUaRCzSxPG7RAFZx 7x3CQJ1AbOrUFtEcuEG2HFUFcp4tMsqDG0H8yuRx+J3tepu1gPw8E+jQts6A64ZbvIPd A/oWPRejupPqmvt3JzT8Dpa0xl7DZ8BPoA8DxnMUZhUHIl91ELIlp+MhYNijJVfgwY02 ri0OSaoZVt2eQ9Ig35rcgOurEYfFySwQG/ud2zqeCtmflbioAGoDnoErXzez1Q+qUF0q puKVrYGxfG97GtC/4LXnz+Xjd5fvOrwQVBuZh15oJebB4hZqqzsk6sLGN8KlWvA8B6Tm xVNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=zeWGhPb9Uhi362exnAeOjISmIIYDfYSBn1HEwyU2NVE=; b=qPXoiSatdeWbdIn+RMrx0ovPYMbz9AD5VXMkH8xo1lEDTGyL3M9aKzuZjJJ9PdrwT9 tQi6u7jxpb94z14f5k1HR50xZPURxv1OU+U+B5jogJzM095bW0b7iL9StWovlQV/cF9w 64TxZe9dVutiWDecGjjHS8Ien2DeoxrRxUgYkPkGPADSZEXAAVS9h1EB3zjR/9ibBQ90 rjU61bLRtZpfJVblJ9CAc2KK3/GgBsjivepuhnvtebdbsQuZzR3PWH0BX2YoAstee4ri kEWsOi+kKU02mFqdwHRKDTZJW0PwLHLqu49dSSj9N2xZcXfG3fZfM6APtj7+8lTkb+L9 kCZQ== X-Gm-Message-State: AGRZ1gLbzwQPKj+UJR4yoVIfrgVzS3uLwHLva83UG9z+6U7bop5MPNLV a0LkhaoBGitTXPo9hpdbWUKgugYI X-Google-Smtp-Source: AJdET5cHj1udJmZAU40Z402Zj2MJRnJ0mSOpvEjbfmyqUY9lT5zx0mQyt9hF42DUKAD6TFjq6xiNmQ== X-Received: by 2002:a63:f210:: with SMTP id v16-v6mr9025065pgh.371.1540706587456; Sat, 27 Oct 2018 23:03:07 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id b69-v6sm613354pfc.150.2018.10.27.23.03.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:03:06 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <98d2e945-9b8d-a717-9868-708d335d6b19@gmail.com> Date: Sun, 28 Oct 2018 00:03:05 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 23673 notabug close 23673 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.181 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 23673 notabug close 23673 From unknown Tue Jun 24 22:35:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Nov 2018 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator