Hi
I'm trying to write a script to display all processes with a ppid that I am holding in an array. Can anyone suggest what ps command should be used. My current code is below:
while (( i < ${NUMPIDS} )) #while the array count < i
do
if [ i -eq 0 ] #set the header with pid 0
then
echo "\t \t`ps -p 999999999999999999 -o pid,user,time,args`\n" # set up header
((i+=1))
fi
echo "\t $i -- \t`ps -p ${pidarray} -o pid,user,time,args|tail -1`\n"
((i+=1))
done
Thanks
I'm trying to write a script to display all processes with a ppid that I am holding in an array. Can anyone suggest what ps command should be used. My current code is below:
while (( i < ${NUMPIDS} )) #while the array count < i
do
if [ i -eq 0 ] #set the header with pid 0
then
echo "\t \t`ps -p 999999999999999999 -o pid,user,time,args`\n" # set up header
((i+=1))
fi
echo "\t $i -- \t`ps -p ${pidarray} -o pid,user,time,args|tail -1`\n"
((i+=1))
done
Thanks