process ID

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am starting a process with the system command via a php page. I want  
to put a button on the same page which will let the user kill the  
process by clicking that button. To do this, I need to know the process  
ID. I could grep for it, but that also returns the grep command. How can  
I make PHP tell me the process ID of a process I started? It seems as if  
this would not be a problem but I guess I am missing something.

Thanks to anyone who can shed some light on this little problem!

Re: process ID

Curt Gilroy wrote:

Quoted text here. Click to load it

Add another grep to the command line, perhaps? Like this:

# ps aux | grep processname | grep -v grep

Excerpt from the manual entry for grep:
  -v, --invert-match
         Invert the sense of matching, to select non-matching lines.

So adding "grep -v grep" will go through that already grepped list and
return the lines that *don't* contain the process for grep.

Kim André Akerø
(remove NOSPAM to contact me directly)

Re: process ID

Kim André Akerø wrote:
Quoted text here. Click to load it
Thanks for the help, that fixed my issue!

Site Timeline