|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Grep or Awk from a non-terminating program
Hey all,
Does anybody know how to grep or awk from a non-terminating program. For example the program top which displays the process cpu usage, idle %,...etc. I was wondering if I can grep or awk certain fields from it. ![]() The other thing I was wondering about is how to insert a CTRL-C command in a shell script, is it possible?? Thanks in advance |
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
you can. Just send the input to the awk interpreter. Quote:
Code:
top -bn10 | awk ... Check your top implementation's man pages for the exact command on your system. |
|
#3
|
|||
|
|||
|
Quote:
Code:
kill -INT pid If for some reason the script is sending ^C (SIGINT) to itself, then "$$" can be used as the pid. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can i terminating expect script without terminating SSH connection. | fozay | Shell Programming and Scripting | 2 | 07-14-2009 01:25 AM |
| Terminating Processes by Name | love833 | HP-UX | 1 | 02-12-2008 08:49 AM |
| Terminating child script with terminating the parent script | mervin2006 | UNIX for Dummies Questions & Answers | 2 | 05-02-2007 07:54 AM |
| grep within ksh program | cin2000 | Shell Programming and Scripting | 3 | 02-22-2006 09:55 AM |
| Terminating myself | SeeD | UNIX for Dummies Questions & Answers | 2 | 04-13-2004 05:35 AM |