Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 2003 19:15:48 +0100
From:      "Vince Hoffman" <vince.hoffman@uk.circle.com>
To:        "lbland" <lbland@vvi.com>, <freebsd-questions@freebsd.org>
Subject:   Re: editing uptime output with sed?
Message-ID:  <003501c32220$86a8c090$1600020a@uk.circle.com>
References:  <71D66F70-8E10-11D7-A088-0030659A531A@vvi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@vvi.com>
To: <freebsd-questions@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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003501c32220$86a8c090$1600020a>