Cedric Blancher
2013-11-14 16:34:54 UTC
Glenn, doesn't AST have uptime, w and who commands too?
Ced
---------- Forwarded message ----------
From: Gary Mills <gary_mills at fastmail.fm>
Date: 14 November 2013 17:32
Subject: [developer] Webrev for: 2849 uptime should use locale settings for ...
To: developer at lists.illumos.org
This is for illumos bug `2849 uptime should use locale settings for
current time'
Here is the webrev:
http://cr.illumos.org/~webrev/jgmills/2849-1/
Most of these changes have to do with time formats in the `w' and
`whodo' commands. `uptime' is affected too, but it's simply a link
to `w' that produces output identical to `w -u'.
The time format element %C has changed its meaning. The replacement
is %+. Only one of the headers of `whodo' is affected by this change.
These commands cannot determine if a 12-hour or a 24-hour clock is
used in the current locale. The solution is to always display the
current time in 24-hour format. This solution was already adopted by
other commands that display the time. The change affects the headers
produced by `w -u', `uptime', and `whodo -l'.
As well, the commands `w' and `whodo -l' now display the login time
in 24-hour format.
Where the commands formerly displayed `am' or `pm', I've added two
spaces to maintain column alignment.
There were a number of instances where the second argument of
dcgettext() was only a time format string, with the result of that
translation passed to strftime(). Since strftime() already does a
translation, I've omitted the dcgettext() function call.
Here are some results of my testing, first in the en_CA.UTF-8 locale:
$ w -u
4:16pm up 57 day(s), 2:37, 3 users, load average: 0.02, 0.02, 0.30
$ usr/src/cmd/w/amd64/w -u
16:16 up 57 day(s), 2:36, 3 users, load average: 0.02, 0.02, 0.31
$ w
7:31am up 64 day(s), 17:52, 3 users, load average: 0.02, 0.02, 0.02
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 5137:51 4 w
mills pts/2 9Sep13 9:28 1:27 2 -ksh
mills pts/3 5:45pm 13:36 -ksh
# usr/src/cmd/w/amd64/w
08:27 up 64 day(s), 18:47, 3 users, load average: 0.02, 0.02, 0.02
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 55 5137:51 4 -ksh
mills pts/2 9Sep13 1:27 2 usr/src/cmd/w/amd64/w
mills pts/3 17:45 14:32 -ksh
$ whodo -l
7:32am up 64 day(s), 17 hr(s), 52 min(s) 3 user(s)
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 5137:51 4 whodo -l
mills pts/2 9Sep13 9:28 1:27 2 -ksh
mills pts/3 5:45pm 13:37 -ksh
# usr/src/cmd/whodo/amd64/whodo -l
08:27 up 64 day(s), 18 hr(s), 48 min(s) 3 user(s)
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 55 5137:51 4 -ksh
mills pts/2 9Sep13 1:27 2
usr/src/cmd/whodo/amd64/whodo -l
mills pts/3 17:45 14:32 -ksh
$ whodo
20
ati
...
# usr/src/cmd/whodo/amd64/whodo
13 November, 2013 08:27:52 AM CST
ati
...
And in other locales:
$ env TZ=UTC LC_TIME=sr_BA.UTF-8 w -u
10:26popodne up 57 day(s), 2:47, 3 users, load average: 0.02,
0.02, 0.16
# env TZ=UTC LC_TIME=sr_BA.UTF-8 usr/src/cmd/w/amd64/w -u
22:22 up 57 day(s), 2:43, 3 users, load average: 0.02, 0.02, 0.21
$ env TZ=UTC LC_TIME=de_DE.UTF-8 w -u
10:26nachm. up 57 day(s), 2:47, 3 users, load average: 0.02,
0.02, 0.16 # env TZ=UTC LC_TIME=de_DE.UTF-8 usr/src/cmd/w/amd64/w
-u
22:22 up 57 day(s), 2:43, 3 users, load average: 0.02, 0.02, 0.20
$ env TZ=UTC LC_TIME=zh_CN.UTF-8 w -u
10:26?? up 57 day(s), 2:47, 3 users, load average: 0.02, 0.02, 0.16
# env TZ=UTC LC_TIME=zh_CN.UTF-8 usr/src/cmd/w/amd64/w -u
22:23 up 57 day(s), 2:44, 3 users, load average: 0.02, 0.02, 0.19
The original bug report is at:
https://www.illumos.org/issues/2849
--
-Gary Mills- -refurb- -Winnipeg, Manitoba, Canada-
-------------------------------------------
illumos-developer
Archives: https://www.listbox.com/member/archive/182179/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182179/21175010-3e2de3b9
Modify Your Subscription:
https://www.listbox.com/member/?member_id=21175010&id_secret=21175010-7e834616
Powered by Listbox: http://www.listbox.com
Ced
---------- Forwarded message ----------
From: Gary Mills <gary_mills at fastmail.fm>
Date: 14 November 2013 17:32
Subject: [developer] Webrev for: 2849 uptime should use locale settings for ...
To: developer at lists.illumos.org
This is for illumos bug `2849 uptime should use locale settings for
current time'
Here is the webrev:
http://cr.illumos.org/~webrev/jgmills/2849-1/
Most of these changes have to do with time formats in the `w' and
`whodo' commands. `uptime' is affected too, but it's simply a link
to `w' that produces output identical to `w -u'.
The time format element %C has changed its meaning. The replacement
is %+. Only one of the headers of `whodo' is affected by this change.
These commands cannot determine if a 12-hour or a 24-hour clock is
used in the current locale. The solution is to always display the
current time in 24-hour format. This solution was already adopted by
other commands that display the time. The change affects the headers
produced by `w -u', `uptime', and `whodo -l'.
As well, the commands `w' and `whodo -l' now display the login time
in 24-hour format.
Where the commands formerly displayed `am' or `pm', I've added two
spaces to maintain column alignment.
There were a number of instances where the second argument of
dcgettext() was only a time format string, with the result of that
translation passed to strftime(). Since strftime() already does a
translation, I've omitted the dcgettext() function call.
Here are some results of my testing, first in the en_CA.UTF-8 locale:
$ w -u
4:16pm up 57 day(s), 2:37, 3 users, load average: 0.02, 0.02, 0.30
$ usr/src/cmd/w/amd64/w -u
16:16 up 57 day(s), 2:36, 3 users, load average: 0.02, 0.02, 0.31
$ w
7:31am up 64 day(s), 17:52, 3 users, load average: 0.02, 0.02, 0.02
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 5137:51 4 w
mills pts/2 9Sep13 9:28 1:27 2 -ksh
mills pts/3 5:45pm 13:36 -ksh
# usr/src/cmd/w/amd64/w
08:27 up 64 day(s), 18:47, 3 users, load average: 0.02, 0.02, 0.02
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 55 5137:51 4 -ksh
mills pts/2 9Sep13 1:27 2 usr/src/cmd/w/amd64/w
mills pts/3 17:45 14:32 -ksh
$ whodo -l
7:32am up 64 day(s), 17 hr(s), 52 min(s) 3 user(s)
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 5137:51 4 whodo -l
mills pts/2 9Sep13 9:28 1:27 2 -ksh
mills pts/3 5:45pm 13:37 -ksh
# usr/src/cmd/whodo/amd64/whodo -l
08:27 up 64 day(s), 18 hr(s), 48 min(s) 3 user(s)
User tty login@ idle JCPU PCPU what
mills pts/1 9Sep13 55 5137:51 4 -ksh
mills pts/2 9Sep13 1:27 2
usr/src/cmd/whodo/amd64/whodo -l
mills pts/3 17:45 14:32 -ksh
$ whodo
20
ati
...
# usr/src/cmd/whodo/amd64/whodo
13 November, 2013 08:27:52 AM CST
ati
...
And in other locales:
$ env TZ=UTC LC_TIME=sr_BA.UTF-8 w -u
10:26popodne up 57 day(s), 2:47, 3 users, load average: 0.02,
0.02, 0.16
# env TZ=UTC LC_TIME=sr_BA.UTF-8 usr/src/cmd/w/amd64/w -u
22:22 up 57 day(s), 2:43, 3 users, load average: 0.02, 0.02, 0.21
$ env TZ=UTC LC_TIME=de_DE.UTF-8 w -u
10:26nachm. up 57 day(s), 2:47, 3 users, load average: 0.02,
0.02, 0.16 # env TZ=UTC LC_TIME=de_DE.UTF-8 usr/src/cmd/w/amd64/w
-u
22:22 up 57 day(s), 2:43, 3 users, load average: 0.02, 0.02, 0.20
$ env TZ=UTC LC_TIME=zh_CN.UTF-8 w -u
10:26?? up 57 day(s), 2:47, 3 users, load average: 0.02, 0.02, 0.16
# env TZ=UTC LC_TIME=zh_CN.UTF-8 usr/src/cmd/w/amd64/w -u
22:23 up 57 day(s), 2:44, 3 users, load average: 0.02, 0.02, 0.19
The original bug report is at:
https://www.illumos.org/issues/2849
--
-Gary Mills- -refurb- -Winnipeg, Manitoba, Canada-
-------------------------------------------
illumos-developer
Archives: https://www.listbox.com/member/archive/182179/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182179/21175010-3e2de3b9
Modify Your Subscription:
https://www.listbox.com/member/?member_id=21175010&id_secret=21175010-7e834616
Powered by Listbox: http://www.listbox.com
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur