Quote:
|
CodeJockey will probably have an answer for this.
|
Well, I
might if I'd ever get off my digital derriere ... (

) ...
Actually, LwdSquashman has got things pretty well covered -- but of course, there are other variations. As earlier posts mentioned the punctuation in the output from uptime is a problem (also true of the w and top commands, which also report this information). You might use something like this:
OUTPUT="`uptime | tr -d ','`"
set $OUTPUT
ARGCOUNT=`expr $# - 3`
shift $ARGCOUNT
echo one minute loadavg is $1
echo five minute loadavg is $2
echo fifteen minute loadavg is $3
which assumes that the data of interest will always be the last 3 fields in the output from the uptime command.
Hope this helps.