-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The Tuesday 2007-12-11 at 10:28 -0800, Randall R Schulz wrote:
set `/sbin/hwclock --show`
HWC=$4
Two things:
1) Field four of the output from hwclock is the year.
In mine, it is 'HH:MM:SS'. See:
/sbin/hwclock --show
set `/sbin/hwclock --show`
echo -0 $0 -1 $1 -2 $2 -3 $3 -4 $4
HWC=$4
echo $4
nimrodel:~ # testtime
Tue Dec 11 20:17:31 2007 -0.536433 seconds
- -0 /root/bin/testtime -1 Tue -2 Dec -3 11 -4 20:17:32
20:17:32
Tue Dec 11 20:17:31 2007 -0.536433 seconds
1 2 3 4 5 6 7
I did my tests to check that days ago :-)
2) The last field of the output is the current discrepancy between the
hardware clock and the system clock. Isn't that what you're trying to
learn?
Yes and no... you can see if you execute this:
hwclock --show ; date
several times. I get:
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:26:27 2007 -0.598335 seconds
Tue Dec 11 20:26:27 CET 2007
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:26:30 2007 -0.502001 seconds
Tue Dec 11 20:26:30 CET 2007
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:26:32 2007 -0.274757 seconds
Tue Dec 11 20:26:32 CET 2007
and you see the command waits some time before exiting; that wait time I
think is that number. It probably waits till the next second boundary,
then prints and exit.
If it were the time difference beetween both clocks, it would be a
constant.
...
Or maybe there is something to get the absolute value.
One my 10.0 system:
% while true; do hwclock; sleep 10; done
Tue 11 Dec 2007 10:25:14 AM PST -0.877900 seconds
Tue 11 Dec 2007 10:25:25 AM PST -0.988284 seconds
Tue 11 Dec 2007 10:25:36 AM PST -0.983046 seconds
Tue 11 Dec 2007 10:25:47 AM PST -0.989136 seconds
Tue 11 Dec 2007 10:25:58 AM PST -0.988547 seconds
Tue 11 Dec 2007 10:26:09 AM PST -0.987777 seconds
Tue 11 Dec 2007 10:26:20 AM PST -0.989716 seconds
Tue 11 Dec 2007 10:26:31 AM PST -0.980444 seconds
Tue 11 Dec 2007 10:26:42 AM PST -0.933735 seconds
Tue 11 Dec 2007 10:26:53 AM PST -0.982149 seconds
Tue 11 Dec 2007 10:27:04 AM PST -0.994643 seconds
Tue 11 Dec 2007 10:27:15 AM PST -0.978735 seconds
Tue 11 Dec 2007 10:27:26 AM PST -0.940854 seconds
^C
On my 10.3 system:
% while true; do hwclock; sleep 10; done
Tue 11 Dec 2007 10:25:16 AM PST -0.000481 seconds
Tue 11 Dec 2007 10:25:26 AM PST -0.000754 seconds
Tue 11 Dec 2007 10:25:36 AM PST -0.000752 seconds
Tue 11 Dec 2007 10:25:46 AM PST -0.000759 seconds
Tue 11 Dec 2007 10:25:56 AM PST -0.000756 seconds
Tue 11 Dec 2007 10:26:06 AM PST -0.000758 seconds
Tue 11 Dec 2007 10:26:16 AM PST -0.000755 seconds
Tue 11 Dec 2007 10:26:26 AM PST -0.000761 seconds
Tue 11 Dec 2007 10:26:36 AM PST -0.000766 seconds
Tue 11 Dec 2007 10:26:46 AM PST -0.000758 seconds
Tue 11 Dec 2007 10:26:56 AM PST -0.000758 seconds
Tue 11 Dec 2007 10:27:06 AM PST -0.000760 seconds
^C
They're running on completely different hardware, but both use NTP.
The "number" is almost the same because the sample is taken with a period
multiple of 1 second. If you do it manually, you will see greater
differences - like my run:
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:28:06 2007 -0.136918 seconds
Tue Dec 11 20:28:06 CET 2007
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:28:08 2007 -0.152102 seconds
Tue Dec 11 20:28:08 CET 2007
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:28:11 2007 -0.350430 seconds
Tue Dec 11 20:28:11 CET 2007
nimrodel:~ # hwclock --show ; date
Tue Dec 11 20:28:14 2007 -0.001126 seconds
Tue Dec 11 20:28:14 CET 2007
nimrodel:~ #
...
Both have good man pages.
And "info" pages.
Gack!
X'-)
Try "pinfo" instead of "info". The human interface is ussable ;-)
- --
Cheers,
Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
iD8DBQFHXuUCtTMYHG2NR9URAhfqAJkBK0Wq2rlsELePMkjhO/5CwmGkVACdGfgX
QEH1WZnfgnDc605lph0RFEY=
=U2bT
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]