uptime options

Hi All

is there a way that i can return uptime if the machine has been on for longer than 4 days

thanks
ab

The uptime command gives how long the system has been up in days, hours, minutes and seconds.

What are you doing now that has a problem with "four days"?

in other words i am looking for a way to see if a machine has been on for a certain amount of time
i thought maybe uptime would be a good place to start

if you have another way that would be great

Well maybe something like:

$
$
$ cat testup
#! /usr/bin/perl

open UPTIME, "</proc/uptime";
$_ = <UPTIME>;
chomp;
($uptime , $junk) = split;
$uptime = int $uptime;
print "uptime = $uptime seconds\n";
$uptime = int($uptime / 3600);
$uptime = int($uptime / 24);
print "uptime = $uptime days\n";
if ($uptime >= 4) {
        exec "uptime";
}
$
$
$ ./testup
uptime = 2680750 seconds
uptime = 31 days
 17:46:36 up 31 days, 39 min,  4 users,  load average: 0.00, 0.00, 0.00
$

This is Linux specific, but you posted the question in the Linux forum.