#!/usr/local/bin/perl -w #-*-perl-*- # use strict; use vars qw ( @WhoList ); use Win32; use Win32::NetAdmin; use Date::Calc qw( Delta_DHMS ); my ($VERSION) = '$Revision: 1.0 $' =~ /([.\d]+)/; my $warnings = 0; # Print a usuage message on a unknown option. $SIG {__WARN__} = sub { if (substr ($_ [0], 0, 14) eq "Unknown option") {die "Usage"}; require File::Basename; $0 = File::Basename::basename ($0); $warnings = 1; warn "$0: @_"; }; $SIG {__DIE__} = sub { require File::Basename; $0 = File::Basename::basename ($0); if (substr ($_ [0], 0, 5) eq "Usage") { die < 0; printf " %2d:%2d up %d days, %2d:%2d, %2d %s\n", $Now[3], $Now[4], $Diff[0], $Diff[1], $Diff[2], $#WhoList + 1, $UserPlural; =pod =head1 NAME B - show how long the system has been up =head1 SYNOPSIS B [ -h ] =head1 DESCRIPTION The B command prints the current time, the length of time the system has been up, and the number of users logged on. =head2 OPTIONS The following options are supported: =over 4 =item -h Display syntax. =back =head1 EXAMPLE Below is an example of the output B provides: C:\> uptime 10:10 up 0 days, 18:40, 2 users =head1 ENVIRONMENT The working of B is not influenced by any environment variables. =head1 BUGS B returns an approximate uptime. It uses the Win32::GetTickCount() function, an imprecise mechanism. A better way to derrive the last boot is to query the event log for the most recent 6005 or 6009 event and grab that time. If log files are large, this can be time consuming. If you need this kind of resolution, use B. B does not seem to want to pad numbers with '0's. =head1 STANDARDS It does not make sense to talk about standards in a B manual page. =head1 REVISION HISTORY uptime Revision 1.0 2000/06/22 10:05:57 idnopheq Initial revision =head1 AUTHOR The Perl implementation of B was written by Dexter Coffin, I. =head1 COPYRIGHT and LICENSE This program is copyright by Dexter Coffin 2000. This program is free and open software. You may use, copy, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same. =head1 SEE ALSO =for html who

=head1 NEXT TOPIC =cut