Quote:
Originally Posted by
ronit_ok2000
hiiiiiiiiii
this is shyam.i have written a code that it will take the process id of any process and using it print the value of pcpu etc but the problem is it prints
the same value every time it is in loop the code for this is given below.
while true
do
y=`ps -p $pid -o pid,ppid,user,group,pcpu,pmem,rss,osz,vsz,comm`
echo "$y"
sleep 1s
done
i want to print all the frquently changing values .
can anyone please help me
thanks for ur advice but the thing i want to happen is to print different values of pcpu or pmem at intervals
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald]
this is the output where 0.8 is pcpu but everytime it is 0.8
but originally it is varying and i want pcpu to be varying everytime