#!/usr/bin/perl
$who = "/usr/bin/who | wc -l";
$ps = "/bin/ps -ef | wc -l";
chomp($numUsers = int(`$who`));
# We subtract two because ps generates a header and the ps process
# is counted as running.
chomp($numProcesses = int(`$ps`) - 2);
print "$numUsers\n";
print "$numProcesses\n";
#
# The following code prints the system uptime and the hostname. These two
# items need to be included in every script that you write and should be the
# very last thing that is printed.
#
chomp($uptime = `/usr/bin/uptime`);
print "$uptime\n";
chomp($hostname = `/bin/hostname`);
print "$hostname\n";