Hello Eric!

Mon, Dec 12, 2005 at 10:04:51AM -0600 you wrote:

> I was wondering if someone could explain why it is sometimes there and 
> not other times.

Sometimes the ps process manages to catch the system state when grep has
not been started yet by the shell. Sometimes it doesn't.

> And how I should correctly go about detecting if the 
> process is running before I perform my action.

You may use the -c flag of ps:

     -c      Change the ``command'' column output to just contain the exe-
             cutable name, rather than the full command line.

Like:

[EMAIL PROTECTED]:~> ps axc |grep init
    1  ??  ILs    0:00,00 init

-- 
DoubleF
No virus detected in this message. Ehrm, wait a minute...
/kernel: pid 56921 (antivirus), uid 32000: exited on signal 9
Oh yes, no virus:)

Attachment: pgpMqVIJl7TcG.pgp
Description: PGP signature

Reply via email to