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