Sponsored Content
Full Discussion: GeekTool
Top Forums UNIX for Dummies Questions & Answers GeekTool Post 302189580 by era on Saturday 26th of April 2008 02:39:08 PM
Old 04-26-2008
Might as well use awk all the way.

Code:
uptime | awk '{sub(":", "h", $3); sub(",", "min", $3); print "Uptime: " $3}'

The sub function might not exist in your awk, but there are other similar functions you can explore.
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

geekTool

Hello! Here is my problem: I try to display the uptime of my computer on my desktop with the help of a tool called GeekTool (for Mac). I want the uptime output to look like that: x day(s) y h z min (but if the pc is only running e.g for several minutes it should leave out the day and the... (1 Reply)
Discussion started by: MastaFue
1 Replies
ruptime(1)                                                         User Commands                                                        ruptime(1)

NAME
ruptime - show host status of local machines SYNOPSIS
ruptime [-ar] [-l | -t | -u] DESCRIPTION
The ruptime utility gives a status line like uptime (see uptime(1)) for each machine on the local network; these are formed from packets broadcast by each host on the network approximately every three minutes. Machines for which no status report has been received for 11 minutes are shown as being down. Normally, the listing is sorted by host name, but this order can be changed by specifying one of the options listed below. OPTIONS
The following options are supported: -a Counts even those users who have been idle for an hour or more. -r Reverses the sorting order. -l | -t | -u These options are mutually exclusive. The use of one overrides the previous one(s). -l Sorts the display by load average. -t Sorts the display by up time. -u Sorts the display by number of users. FILES
/var/spool/rwho/whod.* data files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWrcmdc | +-----------------------------+-----------------------------+ SEE ALSO
uptime(1), rwho(1), in.rwhod(1M), attributes(5) SunOS 5.10 6 Nov 2000 ruptime(1)
All times are GMT -4. The time now is 09:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy