1 |
On 7/1/2011, at 6:26am, Alan McKinnon wrote: |
2 |
>> ... |
3 |
>> Can anyone else reproduce this, please, or tell me what behaviour is |
4 |
>> expected? |
5 |
>> |
6 |
>> $ locale |
7 |
>> LANG=en_GB.UTF-8 |
8 |
>> LC_CTYPE="en_GB.UTF-8" |
9 |
>> LC_NUMERIC="en_GB.UTF-8" |
10 |
>> ... |
11 |
>> $ date +"%l:%M%P" |
12 |
>> 1:39 |
13 |
>> $ LC_TIME="POSIX" |
14 |
>> $ date +"%l:%M%P" |
15 |
>> 1:39am |
16 |
>> $ |
17 |
> |
18 |
> Your output looks fine, except for the last two commands. LC_TIME is an |
19 |
> envvar, you have set it without exporting it, then ran data again and got a |
20 |
> change. I don't understand how you managed that as LC_TIME would no longer be |
21 |
> POSIX at that stage: |
22 |
> |
23 |
> $ cat /etc/env.d/02locale |
24 |
> LANG="en_GB.utf8" |
25 |
> $ locale |
26 |
> LANG=en_GB.utf8 |
27 |
> LC_CTYPE="en_GB.utf8" |
28 |
> LC_NUMERIC="en_GB.utf8" |
29 |
> LC_TIME="en_GB.utf8" |
30 |
> ... |
31 |
> $ date +"%l:%M%P" |
32 |
> 8:16 |
33 |
> $ LC_TIME="POSIX" |
34 |
> $ date +"%l:%M%P" |
35 |
> 8:17 |
36 |
> $ LC_TIME="POSIX" date +"%l:%M%P" |
37 |
> 8:18am |
38 |
|
39 |
I've just tested on another machine. It seems like if I set it to match the first machine with both environments in the /etc/env.d/02locale: |
40 |
|
41 |
$ cat /etc/env.d/02locale |
42 |
LANG="en_GB.UTF-8" |
43 |
LC_TIME="POSIX" |
44 |
$ sudo env-update && source /etc/profile |
45 |
$ source ~/.bashrc |
46 |
|
47 |
Then I can reproduce switching LC_TIME without exporting or anything else: |
48 |
|
49 |
$ date +"%l:%M%P" |
50 |
4:01pm |
51 |
$ LC_TIME="en_GB.utf8" |
52 |
$ date +"%l:%M%P" |
53 |
4:02 |
54 |
$ LC_TIME="POSIX" |
55 |
$ date +"%l:%M%P" |
56 |
4:02pm |
57 |
$ |
58 |
|
59 |
Removing either (& rebooting, because I don't really understand this stuff) removes the ability. |
60 |
|
61 |
I don't know whether this is supposed to be correct or not; with both environments in /etc/env.d/02locale: |
62 |
|
63 |
$ LC_TIME="POSIX" |
64 |
$ locale |
65 |
LANG=en_GB.UTF-8 |
66 |
LC_CTYPE="en_GB.UTF-8" |
67 |
LC_NUMERIC="en_GB.UTF-8" |
68 |
LC_TIME=POSIX |
69 |
LC_COLLATE="en_GB.UTF-8" |
70 |
LC_MONETARY="en_GB.UTF-8" |
71 |
LC_MESSAGES="en_GB.UTF-8" |
72 |
LC_PAPER="en_GB.UTF-8" |
73 |
LC_NAME="en_GB.UTF-8" |
74 |
LC_ADDRESS="en_GB.UTF-8" |
75 |
LC_TELEPHONE="en_GB.UTF-8" |
76 |
LC_MEASUREMENT="en_GB.UTF-8" |
77 |
LC_IDENTIFICATION="en_GB.UTF-8" |
78 |
LC_ALL= |
79 |
$ LC_TIME="en_GB.utf8" |
80 |
$ locale |
81 |
LANG=en_GB.UTF-8 |
82 |
LC_CTYPE="en_GB.UTF-8" |
83 |
LC_NUMERIC="en_GB.UTF-8" |
84 |
LC_TIME=en_GB.utf8 |
85 |
LC_COLLATE="en_GB.UTF-8" |
86 |
LC_MONETARY="en_GB.UTF-8" |
87 |
LC_MESSAGES="en_GB.UTF-8" |
88 |
LC_PAPER="en_GB.UTF-8" |
89 |
LC_NAME="en_GB.UTF-8" |
90 |
LC_ADDRESS="en_GB.UTF-8" |
91 |
LC_TELEPHONE="en_GB.UTF-8" |
92 |
LC_MEASUREMENT="en_GB.UTF-8" |
93 |
LC_IDENTIFICATION="en_GB.UTF-8" |
94 |
LC_ALL= |
95 |
$ |
96 |
|
97 |
The variable is lacking quotes in the `locale` output above; I have no idea whether or not this makes any difference. |
98 |
|
99 |
Stroller. |