[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'sort' seems to ignore case without any command line switches
From: |
Sergei Steshenko |
Subject: |
'sort' seems to ignore case without any command line switches |
Date: |
Wed, 20 Jun 2001 17:15:50 -0700 |
Hello !
I am using this version of 'sort' shipped with RedHat Linux 7.1:
"
[15] 17:06 address@hidden:/home/sergei> which sort
/bin/sort
[16] 17:06 address@hidden:/home/sergei> /bin/sort --version
sort (GNU textutils) 2.0.11
Written by Mike Haertel.
Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[17] 17:07 address@hidden:/home/sergei>
".
I am trying to sort this file:
"
[18] 17:07 address@hidden:/home/sergei/work> cat Ba.txt
B
a
[19] 17:07 address@hidden:/home/sergei/work>
".
Applying 'sort' to it produces this output:
"
[19] 17:07 address@hidden:/home/sergei/work> /bin/sort Ba.txt
a
B
[20] 17:08 address@hidden:/home/sergei/work
".
I believe the behavior is wrong since in ASCII code 'B', the CAPITAL letter
comes BEFORE 'a' - small letter.
For example, Perl built-in 'sort' behaves correctly regarding this issue:
"
[24] 17:10 address@hidden:/home/sergei/work> cat Ba.txt
B
a
[25] 17:11 address@hidden:/home/sergei/work> perl -e 'print sort
`cat Ba.txt`'
B
a
[26] 17:11 address@hidden:/home/sergei/work>
"
- correct, 'B' is before 'a';
"
[26] 17:11 address@hidden:/home/sergei/work> cat ba.txt
b
a
[27] 17:12 address@hidden:/home/sergei/work> perl -e 'print sort
`cat ba.txt`'
a
b
[28] 17:12 address@hidden:/home/sergei/work>
"
- also correct, 'a' is before 'b'.
If you agree with me that this is a bug, would you please fix it ?
Also, I can fix the source myself, but I would like to be advised on how many
places in the source code can be affected.
Thanks in advance,
Sergei.
- 'sort' seems to ignore case without any command line switches,
Sergei Steshenko <=