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.
Yes,
you can. Just send the input to the awk interpreter.
Quote:
The other thing I was wondering about is how to insert a CTRL-C command in a shell script, is it possible??
You can run top in batch mode (so you don't need to send it Ctrl+C) On Linux it would be something like this:
Check your top implementation's man pages for the exact command on your system.
just like what the subject said
but the ip is different
example
if now my IP is 192.168.0.50 and my name is seed
if i wanna terminate 192.168.0.55 with the same nick of mine, seed
can i do that ?? and what is the command ?? (2 Replies)
Hi,
is there problem with grep command when using ksh?
I had the below command:
/usr/bin/grep \""$Mon $NewDD\"" /tmp/timemanager/intlog.$$ >> /tmp/timemanager/log.$$ 2>/dev/null
when I run ksh in debug mode, this command can not grep anything even the data is in the file.
+ /usr/bin/grep... (3 Replies)
Hi
I was working on a shell script with randomly shows a page of text from a randomly selected topic .As soon as the page is displayed it callers a timer script which keeps on running indefinitely until the timer script is killed by the user.
This is where I have the problem,if I press... (2 Replies)
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
hi all,
i m running few batch process through shell script using nohup command but when session get terminated(due to network, reboot of desktop and closing session directly) all processes terminating abnormally and core file is generating.
application batch process is connecting oracle... (4 Replies)
Hi all , i know i ask a lot of question but these are really hard to solve and important question. I send two scripts:
expect.sh:
#!/usr/local/bin/expect
spawn ssh root@172.30.64.163
expect "login:"
send "root\n"
expect "password:"
send "root\n^M"
interact
and
son.sh:
... (2 Replies)
Hi
I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it
The code is that:
{
if (NF==17){
print $0
}else{
fields=NF;
all=$0;
while... (2 Replies)
I need to run an interactive program in the background so I can grep it for specific data to use for some logic in a script.
There is no quiet or background mode on the program so I plan to redirect a document with commands in it and then to grep the output.
This is almost working, except... (1 Reply)
Hi All,
I am using netstat on AIX to grep info on all open connections. However, unlike on Linux(Centos), I do not get the PID and program name using netstat on AIX.
I need this info to be clubbed along with the information retrieved using netstat version of AIX. Is there a way this can be... (1 Reply)