Package: coreutils
Version: 8.13-3.5
Severity: important
--- Please enter the report below this line. ---
The 'sort' program does not sort . (dot 0x2E) and - (hyphen 0x2D)
For example: a file containing . and - interleaved.
-------------------------------
$ cat sort_bug.txt
. 1
- 2
. 3
- 4
$ od -cbd sort_bug.txt
0000000 . 1 \n - 2 \n . 3 \n - 4 \n
056 040 061 012 055 040 062 012 056 040 063 012 055 040 064 012
8238 2609 8237 2610 8238 2611 8237 2612
0000020
-------------------------------
The above file's content can not be sorted by 'sort' program
-------------------------------
$ sort sort_bug.txt
. 1
- 2
. 3
- 4
-------------------------------
Since the ASCII value of '-' is less than '.', the lines beginning with '-'
should
appear before the lines beginning with '.'.
A C program for sorting strings is able to sort the content of above file
correctly.
-------------------------------
$ cat sort_bug.txt | ./sort_strs
- 2
- 4
. 1
. 3
-------------------------------
PS:- The similar issue is observed on Ubuntu 12.04 (LTS x86_64) and RHEL 6.2
(x86_64) too.
System Information
-------------------------------
$ uname -a
Linux reenu-pc 3.2.5Mitesh #2 SMP Mon Aug 5 03:12:23 IST 2013 x86_64 GNU/Linux
-------------------------------
--- System information. ---
Architecture: amd64
Kernel: Linux 3.2.5Mitesh
Debian Release: 7.0
--- Package information. ---
Package's Depends field is empty.
Package's Recommends field is empty.
Package's Suggests field is empty.
--
Thanks and Regards,
Mitesh Singh Jat
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]