Connecting Tech Pros Worldwide Help | Site Map

process ID

  #1  
Old December 21st, 2005, 06:25 PM
Curt Gilroy
Guest
 
Posts: n/a
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!
  #2  
Old December 21st, 2005, 06:55 PM
Kim André Akerĝ
Guest
 
Posts: n/a

re: process ID


Curt Gilroy wrote:
[color=blue]
> 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![/color]

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ĝ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
  #3  
Old December 21st, 2005, 11:35 PM
Curt Gilroy
Guest
 
Posts: n/a

re: process ID


Kim André Akerĝ wrote:[color=blue]
> Curt Gilroy wrote:
>
>[/color]
Thanks for the help, that fixed my issue!
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtain a Process ID Frank DeLuccia answers 8 November 22nd, 2005 10:57 AM
Excel Process ID Powerguy answers 2 November 21st, 2005 01:31 AM
How to get process ID of a Word.Application object instance? David Akerman answers 0 November 15th, 2005 08:39 PM
Obtain a Process ID Frank DeLuccia answers 8 July 21st, 2005 03:12 PM
Getting your own process ID Joshua Beall answers 7 July 17th, 2005 01:26 PM