[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
one last collating sequence data point
From: |
Bruce Korb |
Subject: |
one last collating sequence data point |
Date: |
Thu, 25 Jan 2007 07:58:56 -0800 |
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
- one last collating sequence data point,
Bruce Korb <=