$isalive = system "ps -ef | grep sendmail | grep -v grep";

if ($isalive) {
        do something
} else {
        do somethingElse
}

-----Original Message-----
From: Baartmans, Hans [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: Check to see if process exists


Is there good way to execute a UNIX 'ps' command from Perl and check to see
if a process is running or exists?  For instance, I would like to check to
see if Sendmail is running.  Under a UNIX shell command you can execute,
'/usr/bin/ps -ef | grep sendmail'.

Is there an easy way to do this in Perl?

Thanks in advance!!!

Hans


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to