From unknown Wed Aug 20 03:11:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16944: Sort program (sort.c) I can't sort by ascii collating sequence over a first column of text. Resent-From: Leslie Satenstein Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 05 Mar 2014 22:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16944 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 16944@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139405984321364 (code B ref -1); Wed, 05 Mar 2014 22:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Mar 2014 22:50:43 +0000 Received: from localhost ([127.0.0.1]:52057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLKe8-0005YS-JG for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:50:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50136) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLKco-0005VZ-Oo for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLKcg-0006vt-3x for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:49:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_50,FORGED_YAHOO_RCVD, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKcg-0006vi-0D for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:49:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKcY-00047B-PE for bug-coreutils@gnu.org; Wed, 05 Mar 2014 17:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLKcQ-0006s4-BH for bug-coreutils@gnu.org; Wed, 05 Mar 2014 17:49:02 -0500 Received: from nm48-vm2.bullet.mail.bf1.yahoo.com ([216.109.115.157]:41288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKcQ-0006rz-45 for bug-coreutils@gnu.org; Wed, 05 Mar 2014 17:48:54 -0500 Received: from [66.196.81.172] by nm48.bullet.mail.bf1.yahoo.com with NNFMP; 05 Mar 2014 22:48:53 -0000 Received: from [98.139.213.8] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 05 Mar 2014 22:48:53 -0000 Received: from [127.0.0.1] by smtp108.mail.bf1.yahoo.com with NNFMP; 05 Mar 2014 22:48:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1394059733; bh=eQM+pNqm81Os5vOCwLzpIxTqgtxq3pzAO50LFHppEsk=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Subject:From:To:Date:Content-Type:X-Mailer:Mime-Version; b=jXXPA94U0mvdofR+xJyxTuahPpZ8Zu4HrhcC5srSUl3kSGZXOdd1FcUi6Nfm57luXplPfQkyv47dUvkfzIMjsHSGPr+tY8M1ry+nOkFCN2iPlvd0BGOalQ3u8iD30cM3BJEq/TOhllXgMgt+tkzCC715e3sWjMrhdTEojPQmJxM= X-Yahoo-Newman-Id: 586853.95798.bm@smtp108.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .3EmTcIVM1lY_C7xcfNN7xtOjhptlw6zgtzJNd_qmPkr79u q76oh42Se.M08kw9nJlTBqdlf0OvDi_0Q1lQ8_TzXOYDzC6hbCrOUVNdbxJF QRGccqUTVBZuMkJt6WHq4_FPBGwn0ihouObjtHbJToN2pVrLUy9obivoU2Sc IWxlIAIXlk._3fAWBite5au4dOWN7YVqr0E2Nz0vAdO9niMzbkGSAyQ4eyZa E5w9m1fGHPinlP0IHUGVxzYHIHe8Ujw9KgRdQrUGuanKD2T0GqkmlMFX_Il2 omhc._HMBVzWdxcP6RIRYPaMR.p5MZMTFBqjxqT2acoUi5szGRPvNxR7jnQw ft..weBwU4204GFX7VAZRdmpjld6NoEuOZj_INaAlSFNJ.BRKRQaJiSaTujg Kml.b3cttdXSxpN2xaLxfhrspXMl7ipDpkbxh8Cphsai2IRKtsLrj34bnNAa 0oClsIcYgCnwt8cPOFWqWgp5ZnUFdwKh.64xwAowtKxz5_D1krWdUtE_toU1 8qaSMXI0Lxik3O1U5YYqPncd.tr1A_mfm1_k.92UyQbZhuriGnvsJD6yllE0 GwvHpTYktAEf4hGd9C8QgDh1YmficUWGobrA- X-Yahoo-SMTP: qWLWhsmswBAJ2u3KnYMy.7_EJg1ktIVt X-Rocket-Received: from [192.168.15.2] (lsatenstein@76.66.192.89 with plain [98.138.105.21]) by smtp108.mail.bf1.yahoo.com with SMTP; 05 Mar 2014 14:48:53 -0800 PST Message-ID: <1394059731.19599.34.camel@fedora20-leslie> From: Leslie Satenstein Date: Wed, 05 Mar 2014 17:48:51 -0500 Content-Type: multipart/alternative; boundary="=-r1Nf9PrY/FpO9NIrfVz4" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Wed, 05 Mar 2014 17:50:36 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (----) --=-r1Nf9PrY/FpO9NIrfVz4 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit I have a problem with the sort utility that I cannot seem to do with sort. I have a file x (below) and I wish to sort only the first column according to the ascii table, in other words, a sort where the sort follows the A..Za..z and of course the other characters as well. I created this file x to illustrate the problem. This is First line of file x is a space character, the backspace char and the textHost=fedora20-leslie RAW Unsorted input (27 lines) filename x Host=fedora20-leslie | | scan from|/home/leslie/Development/scandir scandir.ini |20140223 1245| e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir sha.c |20140223 1245| f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir dirdepth |20140223 1245| 9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir scandirmd5.c |20140223 1245| c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir md5Good.tar |20140223 1245| 8190181f115e74742e1291b915950531|/home/leslie/Development/scandir inih_r27.tar |20140223 1245| a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir test.sh |20140223 1245| 503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir scandir32.c |20140223 1245| 86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir scandir32 |20140223 1245| 5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir md5.c |20140223 1245| 2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir crc32.o |20140223 1245| 10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir sha |20140223 1245| 07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir md5.o |20140223 1245| 4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir mddriver.c |20140223 1245| 581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir sha1.c |20140223 1245| 74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir scandirmd5 |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandir |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir gcc.txt |20140223 1245| b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir scandirsha1.c |20140223 1245| 6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir sha1.h |20140223 1245| d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir dirdepth.c |20140223 1245| a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir x |20140305 1506| d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir crc32.c |20140223 1245| 4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir DATE2 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir DATE1 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir md5 |20140223 1245| a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir sort x places the first line, which collates lower than all the rest of column 1 into row 8 within the output. It also dropped the line with the character x that was showing in column 1 of the raw input. (more below) the following list crc32.c |20140223 1245| 4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir crc32.o |20140223 1245| 10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir DATE1 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir DATE2 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir dirdepth |20140223 1245| 9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir dirdepth.c |20140223 1245| a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir gcc.txt |20140223 1245| b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir Host=fedora20-leslie | | scan from|/home/leslie/Development/scandir inih_r27.tar |20140223 1245| a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir md5 |20140223 1245| a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir md5.c |20140223 1245| 2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir md5Good.tar |20140223 1245| 8190181f115e74742e1291b915950531|/home/leslie/Development/scandir md5.o |20140223 1245| 4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir mddriver.c |20140223 1245| 581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir scandir |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandir32 |20140223 1245| 5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir scandir32.c |20140223 1245| 86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir scandir.ini |20140223 1245| e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir scandirmd5 |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir I get partial results by using the -f parameter as sort -f x (or sort -fb ) Host=fedora20-leslie | | scan from|/home/leslie/Development/scandir crc32.c |20140223 1245| 4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir crc32.o |20140223 1245| 10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir DATE1 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir DATE2 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir dirdepth |20140223 1245| 9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir dirdepth.c |20140223 1245| a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir gcc.txt |20140223 1245| b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir inih_r27.tar |20140223 1245| a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir md5 |20140223 1245| a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir md5.c |20140223 1245| 2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir md5.o |20140223 1245| 4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir md5Good.tar |20140223 1245| 8190181f115e74742e1291b915950531|/home/leslie/Development/scandir mddriver.c |20140223 1245| 581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir scandir |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandir.ini |20140223 1245| e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir scandir32 |20140223 1245| 5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir scandir32.c |20140223 1245| 86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir scandirmd5 |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandirmd5.c |20140223 1245| c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir scandirsha1.c |20140223 1245| 6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir sha |20140223 1245| 07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir sha.c |20140223 1245| f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir sha1.c |20140223 1245| 74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir sha1.h |20140223 1245| d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir test.sh |20140223 1245| 503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir x |20140305 1506| d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir The sort order is not correct with folding, the missing line with the x has returned and my header line remains in row 1, BUT... I am after an ascii sequence sort and out of place are the rows with DATE1 and DATE2. They should actually appears as lines 2 and 3. How do I get the sort to respect the ascii sorting sequence? I can do so for later fields such as sorting any other column such as ... sort -fb -t '|' -k2 x to sort -fb -t '|' k4 x My observation is that there does not appear to be an option that allows me to sort by column 1 without shifting to the left of the all the leading whitespace characters. - If I have found a shortcoming, I would like to propose a new flag so that the sort would actually generate the first column in pure ascii sequence. If the sort is not broken can you propose a new flag to force ascii collating sequence?. (A new flag would allow new functionality but continue to allow the existing sort program use to work as before). Would like to hear back from you. Leslie Satenstein lsatenstein@yahoo.com --=-r1Nf9PrY/FpO9NIrfVz4 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit I have a problem with the sort utility that I cannot seem to do with sort.

I have a file x (below) and I wish to sort only the first column according to the ascii table, in other words, a sort where the sort follows the
A..Za..z  and of course the other characters as well.

I created this file x to illustrate the problem.

This is  First line of file x is a space character, the backspace char and the textHost=fedora20-leslie 

RAW Unsorted input (27 lines) filename x

Host=fedora20-leslie             |        |                       scan from|/home/leslie/Development/scandir
scandir.ini                      |20140223 1245|e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir
sha.c                            |20140223 1245|f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir
dirdepth                         |20140223 1245|9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir
scandirmd5.c                     |20140223 1245|c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir
md5Good.tar                      |20140223 1245|8190181f115e74742e1291b915950531|/home/leslie/Development/scandir
inih_r27.tar                     |20140223 1245|a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir
test.sh                          |20140223 1245|503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir
scandir32.c                      |20140223 1245|86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir
scandir32                        |20140223 1245|5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir
md5.c                            |20140223 1245|2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir
crc32.o                          |20140223 1245|10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir
sha                              |20140223 1245|07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir
md5.o                            |20140223 1245|4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir
mddriver.c                       |20140223 1245|581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir
sha1.c                           |20140223 1245|74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir
scandirmd5                       |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandir                          |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
gcc.txt                          |20140223 1245|b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir
scandirsha1.c                    |20140223 1245|6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir
sha1.h                           |20140223 1245|d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir
dirdepth.c                       |20140223 1245|a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir
x                                |20140305 1506|d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir
crc32.c                          |20140223 1245|4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir
DATE2                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
DATE1                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
md5                              |20140223 1245|a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir



sort x   places the first line, which collates lower than all the rest of column 1  into row 8 within the output.
It also dropped the line with the character x that was showing in column 1 of the raw input.
(more below) the following list

crc32.c                          |20140223 1245|4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir
crc32.o                          |20140223 1245|10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir
DATE1                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
DATE2                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
dirdepth                         |20140223 1245|9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir
dirdepth.c                       |20140223 1245|a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir
gcc.txt                          |20140223 1245|b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir
Host=fedora20-leslie             |        |                       scan from|/home/leslie/Development/scandir
inih_r27.tar                     |20140223 1245|a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir
md5                              |20140223 1245|a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir
md5.c                            |20140223 1245|2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir
md5Good.tar                      |20140223 1245|8190181f115e74742e1291b915950531|/home/leslie/Development/scandir
md5.o                            |20140223 1245|4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir
mddriver.c                       |20140223 1245|581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir
scandir                          |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandir32                        |20140223 1245|5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir
scandir32.c                      |20140223 1245|86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir
scandir.ini                      |20140223 1245|e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir
scandirmd5                       |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir

I get partial results by using the -f parameter as
sort -f   x      (or sort -fb )
Host=fedora20-leslie             |        |                       scan from|/home/leslie/Development/scandir
crc32.c                          |20140223 1245|4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir
crc32.o                          |20140223 1245|10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir
DATE1                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
DATE2                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
dirdepth                         |20140223 1245|9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir
dirdepth.c                       |20140223 1245|a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir
gcc.txt                          |20140223 1245|b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir
inih_r27.tar                     |20140223 1245|a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir
md5                              |20140223 1245|a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir
md5.c                            |20140223 1245|2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir
md5.o                            |20140223 1245|4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir
md5Good.tar                      |20140223 1245|8190181f115e74742e1291b915950531|/home/leslie/Development/scandir
mddriver.c                       |20140223 1245|581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir
scandir                          |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandir.ini                      |20140223 1245|e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir
scandir32                        |20140223 1245|5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir
scandir32.c                      |20140223 1245|86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir
scandirmd5                       |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandirmd5.c                     |20140223 1245|c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir
scandirsha1.c                    |20140223 1245|6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir
sha                              |20140223 1245|07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir
sha.c                            |20140223 1245|f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir
sha1.c                           |20140223 1245|74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir
sha1.h                           |20140223 1245|d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir
test.sh                          |20140223 1245|503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir
x                                |20140305 1506|d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir

The sort order is not correct with folding, the missing line with the x has returned and my header line remains in row 1,
BUT...
I am after an ascii sequence sort and out of place are the rows with DATE1 and DATE2.  They should actually appears as lines 2 and 3.

How do I get the sort to respect the ascii sorting sequence?  I can do so for later fields such as sorting any other column such as ...
sort -fb -t '|' -k2  x   to   sort -fb -t '|' k4   x

My observation is that there does not appear to be an option that allows me to sort by column 1 without shifting to the left of the all the leading whitespace characters.
-
If I have found a shortcoming, I would like to propose a new flag  so that the sort would actually generate the first column in pure ascii sequence.
If the sort is  not broken can you propose a new flag to force ascii collating sequence?.

(A new flag would allow new functionality but continue to allow the existing sort program use to work as before).

Would like to hear back from  you. 

Leslie Satenstein
lsatenstein@yahoo.com

--=-r1Nf9PrY/FpO9NIrfVz4-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 18:18:35 2014 Received: (at control) by debbugs.gnu.org; 5 Mar 2014 23:18:35 +0000 Received: from localhost ([127.0.0.1]:52068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLL59-0006Ku-02 for submit@debbugs.gnu.org; Wed, 05 Mar 2014 18:18:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5017) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLL54-0006Kc-8H; Wed, 05 Mar 2014 18:18:31 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s25NISrp029126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Mar 2014 18:18:29 -0500 Received: from [10.3.113.4] ([10.3.113.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s25NISsr008728; Wed, 5 Mar 2014 18:18:28 -0500 Message-ID: <5317B0C3.6030100@redhat.com> Date: Wed, 05 Mar 2014 16:18:27 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Leslie Satenstein , 16944-done@debbugs.gnu.org Subject: Re: bug#16944: Sort program (sort.c) I can't sort by ascii collating sequence over a first column of text. References: <1394059731.19599.34.camel@fedora20-leslie> In-Reply-To: <1394059731.19599.34.camel@fedora20-leslie> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 16944 notabug thanks On 03/05/2014 03:48 PM, Leslie Satenstein wrote: > I have a problem with the sort utility that I cannot seem to do with > sort. >=20 > I have a file x (below) and I wish to sort only the first column > according to the ascii table, in other words, a sort where the sort > follows the > A..Za..z and of course the other characters as well.=20 >=20 > I created this file x to illustrate the problem. >=20 > This is First line of file x is a space character, the backspace char > and the textHost=3Dfedora20-leslie =20 >=20 > RAW Unsorted input (27 lines) filename x >=20 > Host=3Dfedora20-leslie | | sca= n > from|/home/leslie/Development/scandir > scandir.ini |20140223 1245| > e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir > sha.c |20140223 1245| Umm, your example file got corrupted by your mailer. So it's harder to see what you are actually trying to sort, and what results you are trying to get. Maybe you should actually attach your file 'x' instead of pasting it inline where it gets corrupted. Also, when you say "column 1", did you really mean "field 1" (which occupies multiple character columns) rather than just the literal first character? > The sort order is not correct with folding, the missing line with the x= > has returned and my header line remains in row 1,=20 > BUT... > I am after an ascii sequence sort and out of place are the rows with > DATE1 and DATE2. They should actually appears as lines 2 and 3. Are you setting locale environment variables correctly? The only way to guarantee ASCII collation is to use a locale that enforces it. Many distros these days default to an en_US.UTF-8 locale (or similar) which intentionally does NOT do ascii collation; to override that, you probably want to try 'LC_ALL=3DC sort ...' https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-n= ot-sort-in-normal-order_0021 >=20 > How do I get the sort to respect the ascii sorting sequence? I can do > so for later fields such as sorting any other column such as ... > sort -fb -t '|' -k2 x to sort -fb -t '|' k4 x This looks very suspicious (not to mention a typo - you mention 'k4' when you probably typed '-k4' - it's in your best interest to be more accurate when reporting difficulties you are having). You usually want to use '-k2,2' and not the simpler '-k2' (the longer version sorts on exactly field 2, while the shorthand treats field 2 and then on to the end of the line all as one key). You may want to try the 'sort --debug' flag to see exactly what sort is using during its checks, to make sure it is choosing sort keys that line up with what you think it should. >=20 > My observation is that there does not appear to be an option that allow= s > me to sort by column 1 without shifting to the left of the all the > leading whitespace characters. I didn't parse that - if you are eliding leading whitespace, then you are not sorting by column 1, but by the first non-whitespace character. Oh - maybe you meant sorting by "field 1", which is spelled '-k1,1' (or -k1,1b if you want to ignore leading blanks), and optionally with -t in effect to force field separation to match your expectations instead of occurring on non-blank to blank transitions. > - > If I have found a shortcoming, I would like to propose a new flag so > that the sort would actually generate the first column in pure ascii > sequence. Sort already has a POSIX-mandated option to force pure ascii sorting: LC_ALL=3DC sort ... Therefore, I'm closing this as not a bug. But feel free to ask further questions or provide better details of what you are trying to do, in a way that does not get munged by your mailer. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTF7DEAAoJEKeha0olJ0Nq12EH+wdsIzJ7QONPFWsa/YEETuhb PDu96MwKkP3qOHQq8qinDZ9gNHvD0FkUhLM/95LGBrI23ZHPfWOQ7zzwRsJrYvKK 2Ejf00PK1jzGEc1xJJTQVh4snzYIIp4HVNIv9F6tbR0jrspB3dLgprL+H/VCFFM5 wK0OsBZS/EQs2JPXlvkwQXpaO9aPhJ0Tr8s02KAOEJeBNWYaacSUps1N1x+ccxU9 Bx9Qvj+YuJYBUssENQMKA4JVEyu1KVqZE6BuUi3nnO3brimlHetDL/8TdyEitDiq qbgBdt/uIh6NwxoC0y95E0PkOnbbtz6VOcaqoE1n9ayi1BjDeXfNJavnLeAwgGc= =hUpM -----END PGP SIGNATURE----- --9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm-- From unknown Wed Aug 20 03:11:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Leslie Satenstein Subject: bug#16944: closed (Re: bug#16944: Sort program (sort.c) I can't sort by ascii collating sequence over a first column of text.) Message-ID: References: <5317B0C3.6030100@redhat.com> <1394059731.19599.34.camel@fedora20-leslie> X-Gnu-PR-Message: they-closed 16944 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 16944@debbugs.gnu.org Date: Wed, 05 Mar 2014 23:19:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1394061543-24434-1" This is a multi-part message in MIME format... ------------=_1394061543-24434-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #16944: Sort program (sort.c) I can't sort by ascii collating sequence ove= r a first column of text. which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 16944@debbugs.gnu.org. --=20 16944: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D16944 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1394061543-24434-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 16944-done) by debbugs.gnu.org; 5 Mar 2014 23:18:35 +0000 Received: from localhost ([127.0.0.1]:52066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLL57-0006Kp-Eg for submit@debbugs.gnu.org; Wed, 05 Mar 2014 18:18:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5017) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLL54-0006Kc-8H; Wed, 05 Mar 2014 18:18:31 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s25NISrp029126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Mar 2014 18:18:29 -0500 Received: from [10.3.113.4] ([10.3.113.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s25NISsr008728; Wed, 5 Mar 2014 18:18:28 -0500 Message-ID: <5317B0C3.6030100@redhat.com> Date: Wed, 05 Mar 2014 16:18:27 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Leslie Satenstein , 16944-done@debbugs.gnu.org Subject: Re: bug#16944: Sort program (sort.c) I can't sort by ascii collating sequence over a first column of text. References: <1394059731.19599.34.camel@fedora20-leslie> In-Reply-To: <1394059731.19599.34.camel@fedora20-leslie> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 16944-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 16944 notabug thanks On 03/05/2014 03:48 PM, Leslie Satenstein wrote: > I have a problem with the sort utility that I cannot seem to do with > sort. >=20 > I have a file x (below) and I wish to sort only the first column > according to the ascii table, in other words, a sort where the sort > follows the > A..Za..z and of course the other characters as well.=20 >=20 > I created this file x to illustrate the problem. >=20 > This is First line of file x is a space character, the backspace char > and the textHost=3Dfedora20-leslie =20 >=20 > RAW Unsorted input (27 lines) filename x >=20 > Host=3Dfedora20-leslie | | sca= n > from|/home/leslie/Development/scandir > scandir.ini |20140223 1245| > e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir > sha.c |20140223 1245| Umm, your example file got corrupted by your mailer. So it's harder to see what you are actually trying to sort, and what results you are trying to get. Maybe you should actually attach your file 'x' instead of pasting it inline where it gets corrupted. Also, when you say "column 1", did you really mean "field 1" (which occupies multiple character columns) rather than just the literal first character? > The sort order is not correct with folding, the missing line with the x= > has returned and my header line remains in row 1,=20 > BUT... > I am after an ascii sequence sort and out of place are the rows with > DATE1 and DATE2. They should actually appears as lines 2 and 3. Are you setting locale environment variables correctly? The only way to guarantee ASCII collation is to use a locale that enforces it. Many distros these days default to an en_US.UTF-8 locale (or similar) which intentionally does NOT do ascii collation; to override that, you probably want to try 'LC_ALL=3DC sort ...' https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-n= ot-sort-in-normal-order_0021 >=20 > How do I get the sort to respect the ascii sorting sequence? I can do > so for later fields such as sorting any other column such as ... > sort -fb -t '|' -k2 x to sort -fb -t '|' k4 x This looks very suspicious (not to mention a typo - you mention 'k4' when you probably typed '-k4' - it's in your best interest to be more accurate when reporting difficulties you are having). You usually want to use '-k2,2' and not the simpler '-k2' (the longer version sorts on exactly field 2, while the shorthand treats field 2 and then on to the end of the line all as one key). You may want to try the 'sort --debug' flag to see exactly what sort is using during its checks, to make sure it is choosing sort keys that line up with what you think it should. >=20 > My observation is that there does not appear to be an option that allow= s > me to sort by column 1 without shifting to the left of the all the > leading whitespace characters. I didn't parse that - if you are eliding leading whitespace, then you are not sorting by column 1, but by the first non-whitespace character. Oh - maybe you meant sorting by "field 1", which is spelled '-k1,1' (or -k1,1b if you want to ignore leading blanks), and optionally with -t in effect to force field separation to match your expectations instead of occurring on non-blank to blank transitions. > - > If I have found a shortcoming, I would like to propose a new flag so > that the sort would actually generate the first column in pure ascii > sequence. Sort already has a POSIX-mandated option to force pure ascii sorting: LC_ALL=3DC sort ... Therefore, I'm closing this as not a bug. But feel free to ask further questions or provide better details of what you are trying to do, in a way that does not get munged by your mailer. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTF7DEAAoJEKeha0olJ0Nq12EH+wdsIzJ7QONPFWsa/YEETuhb PDu96MwKkP3qOHQq8qinDZ9gNHvD0FkUhLM/95LGBrI23ZHPfWOQ7zzwRsJrYvKK 2Ejf00PK1jzGEc1xJJTQVh4snzYIIp4HVNIv9F6tbR0jrspB3dLgprL+H/VCFFM5 wK0OsBZS/EQs2JPXlvkwQXpaO9aPhJ0Tr8s02KAOEJeBNWYaacSUps1N1x+ccxU9 Bx9Qvj+YuJYBUssENQMKA4JVEyu1KVqZE6BuUi3nnO3brimlHetDL/8TdyEitDiq qbgBdt/uIh6NwxoC0y95E0PkOnbbtz6VOcaqoE1n9ayi1BjDeXfNJavnLeAwgGc= =hUpM -----END PGP SIGNATURE----- --9ustAxdKJCLHnwd13GoDo9KbtPxD3xHBm-- ------------=_1394061543-24434-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Mar 2014 22:50:43 +0000 Received: from localhost ([127.0.0.1]:52057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLKe8-0005YS-JG for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:50:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50136) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLKco-0005VZ-Oo for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLKcg-0006vt-3x for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:49:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_50,FORGED_YAHOO_RCVD, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKcg-0006vi-0D for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:49:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKcY-00047B-PE for bug-coreutils@gnu.org; Wed, 05 Mar 2014 17:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLKcQ-0006s4-BH for bug-coreutils@gnu.org; Wed, 05 Mar 2014 17:49:02 -0500 Received: from nm48-vm2.bullet.mail.bf1.yahoo.com ([216.109.115.157]:41288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKcQ-0006rz-45 for bug-coreutils@gnu.org; Wed, 05 Mar 2014 17:48:54 -0500 Received: from [66.196.81.172] by nm48.bullet.mail.bf1.yahoo.com with NNFMP; 05 Mar 2014 22:48:53 -0000 Received: from [98.139.213.8] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 05 Mar 2014 22:48:53 -0000 Received: from [127.0.0.1] by smtp108.mail.bf1.yahoo.com with NNFMP; 05 Mar 2014 22:48:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1394059733; bh=eQM+pNqm81Os5vOCwLzpIxTqgtxq3pzAO50LFHppEsk=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Subject:From:To:Date:Content-Type:X-Mailer:Mime-Version; b=jXXPA94U0mvdofR+xJyxTuahPpZ8Zu4HrhcC5srSUl3kSGZXOdd1FcUi6Nfm57luXplPfQkyv47dUvkfzIMjsHSGPr+tY8M1ry+nOkFCN2iPlvd0BGOalQ3u8iD30cM3BJEq/TOhllXgMgt+tkzCC715e3sWjMrhdTEojPQmJxM= X-Yahoo-Newman-Id: 586853.95798.bm@smtp108.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .3EmTcIVM1lY_C7xcfNN7xtOjhptlw6zgtzJNd_qmPkr79u q76oh42Se.M08kw9nJlTBqdlf0OvDi_0Q1lQ8_TzXOYDzC6hbCrOUVNdbxJF QRGccqUTVBZuMkJt6WHq4_FPBGwn0ihouObjtHbJToN2pVrLUy9obivoU2Sc IWxlIAIXlk._3fAWBite5au4dOWN7YVqr0E2Nz0vAdO9niMzbkGSAyQ4eyZa E5w9m1fGHPinlP0IHUGVxzYHIHe8Ujw9KgRdQrUGuanKD2T0GqkmlMFX_Il2 omhc._HMBVzWdxcP6RIRYPaMR.p5MZMTFBqjxqT2acoUi5szGRPvNxR7jnQw ft..weBwU4204GFX7VAZRdmpjld6NoEuOZj_INaAlSFNJ.BRKRQaJiSaTujg Kml.b3cttdXSxpN2xaLxfhrspXMl7ipDpkbxh8Cphsai2IRKtsLrj34bnNAa 0oClsIcYgCnwt8cPOFWqWgp5ZnUFdwKh.64xwAowtKxz5_D1krWdUtE_toU1 8qaSMXI0Lxik3O1U5YYqPncd.tr1A_mfm1_k.92UyQbZhuriGnvsJD6yllE0 GwvHpTYktAEf4hGd9C8QgDh1YmficUWGobrA- X-Yahoo-SMTP: qWLWhsmswBAJ2u3KnYMy.7_EJg1ktIVt X-Rocket-Received: from [192.168.15.2] (lsatenstein@76.66.192.89 with plain [98.138.105.21]) by smtp108.mail.bf1.yahoo.com with SMTP; 05 Mar 2014 14:48:53 -0800 PST Message-ID: <1394059731.19599.34.camel@fedora20-leslie> Subject: Sort program (sort.c) I can't sort by ascii collating sequence over a first column of text. From: Leslie Satenstein To: bug-coreutils@gnu.org Date: Wed, 05 Mar 2014 17:48:51 -0500 Content-Type: multipart/alternative; boundary="=-r1Nf9PrY/FpO9NIrfVz4" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 05 Mar 2014 17:50:36 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (----) --=-r1Nf9PrY/FpO9NIrfVz4 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit I have a problem with the sort utility that I cannot seem to do with sort. I have a file x (below) and I wish to sort only the first column according to the ascii table, in other words, a sort where the sort follows the A..Za..z and of course the other characters as well. I created this file x to illustrate the problem. This is First line of file x is a space character, the backspace char and the textHost=fedora20-leslie RAW Unsorted input (27 lines) filename x Host=fedora20-leslie | | scan from|/home/leslie/Development/scandir scandir.ini |20140223 1245| e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir sha.c |20140223 1245| f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir dirdepth |20140223 1245| 9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir scandirmd5.c |20140223 1245| c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir md5Good.tar |20140223 1245| 8190181f115e74742e1291b915950531|/home/leslie/Development/scandir inih_r27.tar |20140223 1245| a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir test.sh |20140223 1245| 503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir scandir32.c |20140223 1245| 86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir scandir32 |20140223 1245| 5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir md5.c |20140223 1245| 2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir crc32.o |20140223 1245| 10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir sha |20140223 1245| 07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir md5.o |20140223 1245| 4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir mddriver.c |20140223 1245| 581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir sha1.c |20140223 1245| 74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir scandirmd5 |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandir |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir gcc.txt |20140223 1245| b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir scandirsha1.c |20140223 1245| 6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir sha1.h |20140223 1245| d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir dirdepth.c |20140223 1245| a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir x |20140305 1506| d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir crc32.c |20140223 1245| 4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir DATE2 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir DATE1 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir md5 |20140223 1245| a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir sort x places the first line, which collates lower than all the rest of column 1 into row 8 within the output. It also dropped the line with the character x that was showing in column 1 of the raw input. (more below) the following list crc32.c |20140223 1245| 4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir crc32.o |20140223 1245| 10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir DATE1 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir DATE2 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir dirdepth |20140223 1245| 9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir dirdepth.c |20140223 1245| a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir gcc.txt |20140223 1245| b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir Host=fedora20-leslie | | scan from|/home/leslie/Development/scandir inih_r27.tar |20140223 1245| a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir md5 |20140223 1245| a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir md5.c |20140223 1245| 2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir md5Good.tar |20140223 1245| 8190181f115e74742e1291b915950531|/home/leslie/Development/scandir md5.o |20140223 1245| 4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir mddriver.c |20140223 1245| 581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir scandir |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandir32 |20140223 1245| 5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir scandir32.c |20140223 1245| 86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir scandir.ini |20140223 1245| e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir scandirmd5 |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir I get partial results by using the -f parameter as sort -f x (or sort -fb ) Host=fedora20-leslie | | scan from|/home/leslie/Development/scandir crc32.c |20140223 1245| 4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir crc32.o |20140223 1245| 10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir DATE1 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir DATE2 |20140223 1245| e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir dirdepth |20140223 1245| 9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir dirdepth.c |20140223 1245| a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir gcc.txt |20140223 1245| b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir inih_r27.tar |20140223 1245| a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir md5 |20140223 1245| a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir md5.c |20140223 1245| 2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir md5.o |20140223 1245| 4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir md5Good.tar |20140223 1245| 8190181f115e74742e1291b915950531|/home/leslie/Development/scandir mddriver.c |20140223 1245| 581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir scandir |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandir.ini |20140223 1245| e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir scandir32 |20140223 1245| 5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir scandir32.c |20140223 1245| 86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir scandirmd5 |20140223 1245| 864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir scandirmd5.c |20140223 1245| c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir scandirsha1.c |20140223 1245| 6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir sha |20140223 1245| 07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir sha.c |20140223 1245| f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir sha1.c |20140223 1245| 74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir sha1.h |20140223 1245| d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir test.sh |20140223 1245| 503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir x |20140305 1506| d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir The sort order is not correct with folding, the missing line with the x has returned and my header line remains in row 1, BUT... I am after an ascii sequence sort and out of place are the rows with DATE1 and DATE2. They should actually appears as lines 2 and 3. How do I get the sort to respect the ascii sorting sequence? I can do so for later fields such as sorting any other column such as ... sort -fb -t '|' -k2 x to sort -fb -t '|' k4 x My observation is that there does not appear to be an option that allows me to sort by column 1 without shifting to the left of the all the leading whitespace characters. - If I have found a shortcoming, I would like to propose a new flag so that the sort would actually generate the first column in pure ascii sequence. If the sort is not broken can you propose a new flag to force ascii collating sequence?. (A new flag would allow new functionality but continue to allow the existing sort program use to work as before). Would like to hear back from you. Leslie Satenstein lsatenstein@yahoo.com --=-r1Nf9PrY/FpO9NIrfVz4 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit I have a problem with the sort utility that I cannot seem to do with sort.

I have a file x (below) and I wish to sort only the first column according to the ascii table, in other words, a sort where the sort follows the
A..Za..z  and of course the other characters as well.

I created this file x to illustrate the problem.

This is  First line of file x is a space character, the backspace char and the textHost=fedora20-leslie 

RAW Unsorted input (27 lines) filename x

Host=fedora20-leslie             |        |                       scan from|/home/leslie/Development/scandir
scandir.ini                      |20140223 1245|e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir
sha.c                            |20140223 1245|f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir
dirdepth                         |20140223 1245|9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir
scandirmd5.c                     |20140223 1245|c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir
md5Good.tar                      |20140223 1245|8190181f115e74742e1291b915950531|/home/leslie/Development/scandir
inih_r27.tar                     |20140223 1245|a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir
test.sh                          |20140223 1245|503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir
scandir32.c                      |20140223 1245|86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir
scandir32                        |20140223 1245|5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir
md5.c                            |20140223 1245|2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir
crc32.o                          |20140223 1245|10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir
sha                              |20140223 1245|07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir
md5.o                            |20140223 1245|4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir
mddriver.c                       |20140223 1245|581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir
sha1.c                           |20140223 1245|74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir
scandirmd5                       |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandir                          |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
gcc.txt                          |20140223 1245|b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir
scandirsha1.c                    |20140223 1245|6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir
sha1.h                           |20140223 1245|d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir
dirdepth.c                       |20140223 1245|a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir
x                                |20140305 1506|d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir
crc32.c                          |20140223 1245|4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir
DATE2                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
DATE1                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
md5                              |20140223 1245|a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir



sort x   places the first line, which collates lower than all the rest of column 1  into row 8 within the output.
It also dropped the line with the character x that was showing in column 1 of the raw input.
(more below) the following list

crc32.c                          |20140223 1245|4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir
crc32.o                          |20140223 1245|10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir
DATE1                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
DATE2                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
dirdepth                         |20140223 1245|9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir
dirdepth.c                       |20140223 1245|a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir
gcc.txt                          |20140223 1245|b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir
Host=fedora20-leslie             |        |                       scan from|/home/leslie/Development/scandir
inih_r27.tar                     |20140223 1245|a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir
md5                              |20140223 1245|a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir
md5.c                            |20140223 1245|2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir
md5Good.tar                      |20140223 1245|8190181f115e74742e1291b915950531|/home/leslie/Development/scandir
md5.o                            |20140223 1245|4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir
mddriver.c                       |20140223 1245|581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir
scandir                          |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandir32                        |20140223 1245|5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir
scandir32.c                      |20140223 1245|86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir
scandir.ini                      |20140223 1245|e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir
scandirmd5                       |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir

I get partial results by using the -f parameter as
sort -f   x      (or sort -fb )
Host=fedora20-leslie             |        |                       scan from|/home/leslie/Development/scandir
crc32.c                          |20140223 1245|4d7a5dbb246898ff9d3ba19c0ded7f5b|/home/leslie/Development/scandir
crc32.o                          |20140223 1245|10a49aede5f82d00205c1f89a8931731|/home/leslie/Development/scandir
DATE1                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
DATE2                            |20140223 1245|e606fe0237c786174d2087090f81644a|/home/leslie/Development/scandir
dirdepth                         |20140223 1245|9f2ff1bd8b133ca0de8d124ad7d761d2|/home/leslie/Development/scandir
dirdepth.c                       |20140223 1245|a7c3f1c02245aec9a1b651e11018ff82|/home/leslie/Development/scandir
gcc.txt                          |20140223 1245|b8917c1a087abbf74f0294dad9cbf698|/home/leslie/Development/scandir
inih_r27.tar                     |20140223 1245|a8da6db331c8fe638cbb8c6940ce303e|/home/leslie/Development/scandir
md5                              |20140223 1245|a0509bd4723729ad76ce341844b0db92|/home/leslie/Development/scandir
md5.c                            |20140223 1245|2095124ffca65c307a840082185f5be9|/home/leslie/Development/scandir
md5.o                            |20140223 1245|4bb7270967299fa7fbb5ae4826f9c4c0|/home/leslie/Development/scandir
md5Good.tar                      |20140223 1245|8190181f115e74742e1291b915950531|/home/leslie/Development/scandir
mddriver.c                       |20140223 1245|581b61b0fc14df5e4a78b0db6d0d7ca4|/home/leslie/Development/scandir
scandir                          |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandir.ini                      |20140223 1245|e2c713788f9492be9e61d1d0badcc8ca|/home/leslie/Development/scandir
scandir32                        |20140223 1245|5d26167e56b5e6efe203bdbfb4483c6f|/home/leslie/Development/scandir
scandir32.c                      |20140223 1245|86c005228b275b55249cde39c2e95d32|/home/leslie/Development/scandir
scandirmd5                       |20140223 1245|864a8f6dfbeb16bef1f09d71759aeca4|/home/leslie/Development/scandir
scandirmd5.c                     |20140223 1245|c38735f1cdf0bbcf7e352876d7f28793|/home/leslie/Development/scandir
scandirsha1.c                    |20140223 1245|6f8e62c3c10c09922f41c643ff0592f8|/home/leslie/Development/scandir
sha                              |20140223 1245|07f74c7c98e3498ca11dba9a5c56edc9|/home/leslie/Development/scandir
sha.c                            |20140223 1245|f20dc5f72f0235d84a07e8a6b80ab036|/home/leslie/Development/scandir
sha1.c                           |20140223 1245|74832014b5b65a34d5eaf273c7393116|/home/leslie/Development/scandir
sha1.h                           |20140223 1245|d2559d2af8a19ea6bc64b35f69c4eea6|/home/leslie/Development/scandir
test.sh                          |20140223 1245|503c5fe5bd4ee7f2ac53d7df0a371bb6|/home/leslie/Development/scandir
x                                |20140305 1506|d41d8cd98f00b204e9800998ecf8427e|/home/leslie/Development/scandir

The sort order is not correct with folding, the missing line with the x has returned and my header line remains in row 1,
BUT...
I am after an ascii sequence sort and out of place are the rows with DATE1 and DATE2.  They should actually appears as lines 2 and 3.

How do I get the sort to respect the ascii sorting sequence?  I can do so for later fields such as sorting any other column such as ...
sort -fb -t '|' -k2  x   to   sort -fb -t '|' k4   x

My observation is that there does not appear to be an option that allows me to sort by column 1 without shifting to the left of the all the leading whitespace characters.
-
If I have found a shortcoming, I would like to propose a new flag  so that the sort would actually generate the first column in pure ascii sequence.
If the sort is  not broken can you propose a new flag to force ascii collating sequence?.

(A new flag would allow new functionality but continue to allow the existing sort program use to work as before).

Would like to hear back from  you. 

Leslie Satenstein
lsatenstein@yahoo.com

--=-r1Nf9PrY/FpO9NIrfVz4-- ------------=_1394061543-24434-1--