Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Return just the...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 2059 of 2317
Post > Topic >>

Return just the text I want from "uptime"

by Eliot <ebp@[EMAIL PROTECTED] > Nov 5, 2007 at 05:35 AM

I want to use the system command "uptime" and then use awk to display
just the text I am interested in:-
Consider the following three lines of input
 18:01:04 up 1 min,  0 users,  load average: 0.55, 0.28, 0.10
 22:14:47 up  1:01,  0 users,  load average: 0.21, 0.05, 0.02
 17:58:52 up 1 day,  2:34,  0 users,  load average: 0.02, 0.02, 0.00
The output for each line should be
1 min
1:01
1 day,  2:34
Of course I only need to send one line at a time to awk, I am
struggling because the number of fields varies.
 




 7 Posts in Topic:
Return just the text I want from "uptime"
Eliot <ebp@[EMAIL PROT  2007-11-05 05:35:55 
Re: Return just the text I want from "uptime"
Janis Papanagnou <Jani  2007-11-05 14:41:12 
Re: Return just the text I want from "uptime"
Eliot <ebp@[EMAIL PROT  2007-11-05 05:46:16 
Re: Return just the text I want from "uptime"
gazelle@[EMAIL PROTECTED]  2007-11-05 14:15:45 
Re: Return just the text I want from "uptime"
ptjm@[EMAIL PROTECTED] (  2007-11-06 02:34:14 
Re: Return just the text I want from "uptime"
Janis Papanagnou <Jani  2007-11-06 04:48:02 
Re: Return just the text I want from "uptime"
Claudio <claudio@[EMAI  2007-11-09 18:22:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:19:43 CDT 2008.