editing uptime output with sed?

Vince Hoffman vince.hoffman at uk.circle.com
Sat May 24 11:15:55 PDT 2003


uptime | sed -e "s/.*\,.*\,.*\,.*\,\(.*\)\,.*/\1/"

note: you could do it much better with awk ( uptime | awk -F , '{ print
$5 }' )

ps not very free bsd related, you'll do better on an shell scripting group
list

Vince
----- Original Message -----
From: "lbland" <lbland at vvi.com>
To: <freebsd-questions at freebsd.org>
Sent: Saturday, May 24, 2003 6:52 PM
Subject: editing uptime output with sed?


> hi-
>
> sorry for the generic question...
>
> how do I take uptime output:
>   1:45PM  up 6 days,  3:58, 11 users, load averages: 0.30, 0.24, 0.21
> and get the 2nd to last value with sed? (how do I get sed to output
> 0.24 to stdout)?
>
> TIA-
>
> -lance
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at freebsd.org"
>



More information about the freebsd-questions mailing list