Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 21st, 2005, 06:25 PM
Curt Gilroy
Guest
 
Posts: n/a
Default process ID

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
Default 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
Default Re: process ID

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

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles