You are here: Re: process ID « PHP Programming Language « IT news, forums, messages
Re: process ID

Posted by Kim Andrι Akerψ on 12/21/05 20:42

Curt Gilroy wrote:

> 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!

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)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация