In the listings below, two programs are involved:  "ls" and "bash".
I am inclined to believe that "bash" treats a missing LC_COLLATE
as "en_US" and "ls" treats it as "C".  If there is such a thing as
an invisible (not in environment variables) "system default locale",
then "ls" is wrong, otherwise "bash" is wrong.  One of the two has
to be wrong.

(Just to be clear:  bash is selecting files with "[a-z]*" and then
ls sorts them based on some collating sequence.  The sorting
collating order should be identical to the selection order.)

$ unset LC_COLLATE
$ ls -go
total 0
-rw-r--r-- 1 0 Jan 25 07:47 AZZ
-rw-r--r-- 1 0 Jan 25 07:47 BZZ
-rw-r--r-- 1 0 Jan 25 07:47 YZZ
-rw-r--r-- 1 0 Jan 25 07:47 ZZZ
-rw-r--r-- 1 0 Jan 25 07:47 aZZ
-rw-r--r-- 1 0 Jan 25 07:47 bZZ
-rw-r--r-- 1 0 Jan 25 07:47 yZZ
-rw-r--r-- 1 0 Jan 25 07:47 zZZ
$ ls -go [a-z]*
-rw-r--r-- 1 0 Jan 25 07:47 AZZ
-rw-r--r-- 1 0 Jan 25 07:47 BZZ
-rw-r--r-- 1 0 Jan 25 07:47 YZZ
-rw-r--r-- 1 0 Jan 25 07:47 aZZ
-rw-r--r-- 1 0 Jan 25 07:47 bZZ
-rw-r--r-- 1 0 Jan 25 07:47 yZZ
-rw-r--r-- 1 0 Jan 25 07:47 zZZ
$ export LC_COLLATE=C
$ ls -go [a-z]*
-rw-r--r-- 1 0 Jan 25 07:47 aZZ
-rw-r--r-- 1 0 Jan 25 07:47 bZZ
-rw-r--r-- 1 0 Jan 25 07:47 yZZ
-rw-r--r-- 1 0 Jan 25 07:47 zZZ
$ export LC_COLLATE=en_US
$ ls -go [a-z]*
-rw-r--r-- 1 0 Jan 25 07:47 aZZ
-rw-r--r-- 1 0 Jan 25 07:47 AZZ
-rw-r--r-- 1 0 Jan 25 07:47 bZZ
-rw-r--r-- 1 0 Jan 25 07:47 BZZ
-rw-r--r-- 1 0 Jan 25 07:47 yZZ
-rw-r--r-- 1 0 Jan 25 07:47 YZZ
-rw-r--r-- 1 0 Jan 25 07:47 zZZ


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to