kill a process
Im working in Suse, and i have a process in C where i use the function "system" to call matlab. I have some problems with matlab, and i need to know how to kill it automatically with another process that is monitoring the matlab.
I think, that the easiest way is with the pid of matlab, and then kill the process by using the pid.
How can i know the pid of matlab, in another process and then kill it? (I have to do this, automatically, running another process)
Thanks for help.
From a shell or script
lists all processes.
ps h -opid -C metlab
should find the metlab process PID
ps h -opid -C metlab | xargs kill
should kill the process