Results 1 to 2 of 2
Hi...I am new to linux...
Please Help me in solving this..
I have two files
like PID USERNAME PROCESSNAME %CPU
Another File With PID TOTAL
This file I ve like
...
- 09-23-2010 #1Just Joined!
- Join Date
- Sep 2010
- Posts
- 0
Hi
Hi...I am new to linux...
Please Help me in solving this..
I have two files
like PID USERNAME PROCESSNAME %CPU
Another File With PID TOTAL
This file I ve like
PID
303
Total 87908K
12343
Total 65785K
I need to check these two wid PIDs and if they match add TOTAL to the PID USERNAME PROCESSNAME %CPU TOTAL.....
PIDs in two files are not in exact sorted manner....
I had a try lyk
rm /scripts/xy.txt
rm /scripts/logs/cpu.txt
a=`prstat 5 1|awk '{print $1" "$2" "$8" "$10}'`
echo $a
for pid in $a
do
echo $pid>>/scripts/xy.txt
pmap $pid|grep -i total>>/scripts/xy.txt
cat /scripts/xy.txt | awk '{print $2}' >> /scripts/logs/cpu.txt
done
Thanks in advance
With Regards
Deepa
- 09-23-2010 #2
Welcome to the forum. Glad you decided to join us.


Reply With Quote
