editing uptime output with sed?

Dan Nelson dnelson at allantgroup.com
Sat May 24 11:12:47 PDT 2003


In the last episode (May 24), lbland said:
> 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)?

uptime | sed -Ee 's/.*([0-9]+.[0-9]+),.*$/\1/'

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list