Getting the uptime of a SunOS UNIX box in seconds only
- by JF
How do I determine the uptime on a SunOS UNIX box in seconds only?
On Linux, I could simply cat /proc/uptime & take the first argument:
cat /proc/uptime | awk '{print $1}'
I'm trying to do the same on a SunOS UNIX box, but there is no /proc/uptime.
There is an uptime command which presents the following output:
$ uptime
12:13pm up 227 day(s), 15:14, 1 user, load average: 0.05, 0.05, 0.05
I don't really want to have to write code to convert the date into seconds only & I'm sure someone must have had this requirement before but I have been unable to find anything on the internet.
Can anyone tell me how to get the uptime in just seconds?
TIA