tomdagliusa
Programmer
My dept. does a bad job of cleaning up old processes.
I would like to be able to su to root, and identify the processes, then kill them. I can identify them ok, but how do I access the process number which I need to send to the kill command? Let's say I pipe a ps auxw | grep "someTerm" into a file. The second column in that file are all the process numbers. I'd love to be able to do something like:
for column2 in `ps auxw | grep "someTerm"`
do
kill -9 $column2
done
BUT, don't know how to get that process id into a shell available variable.
Thanks,
Tom
I would like to be able to su to root, and identify the processes, then kill them. I can identify them ok, but how do I access the process number which I need to send to the kill command? Let's say I pipe a ps auxw | grep "someTerm" into a file. The second column in that file are all the process numbers. I'd love to be able to do something like:
for column2 in `ps auxw | grep "someTerm"`
do
kill -9 $column2
done
BUT, don't know how to get that process id into a shell available variable.
Thanks,
Tom