The nice, clean way is to use Proc::ProcessTable, as in:use strict; my $rc=system("ps -ef | grep [i]netd"); if ($rc) {print "inetd seems to have gone the way of the dodo.\n"};
Warning: the above code is untested. It could work, but it also could wipe your hard drive, send mail professing your never ending devotion to everyone you have ever mailed to, paint your cats green and your house orange and make a camel crawl through the eye of a needle. You have been warned.use strict; use Proc::ProcessTable; my $proctable=Proc::ProcessTable->new; my $proclist= $proctable->table; my @result=map {/(inetd)/} @$proclist; unless (scalar(@result)) {print "inetd->walk({direction=>dodo})\n"};
CU
Robartes-
Update:Got rid of the grep -v grep I mindlessly copy/pasted into the code. Thanks to merlyn for pointing out this important issue. In reply to Re: Test for daemon
by robartes
in thread Test for daemon
by wube
For:
Use:
& & < < > > [ [ ] ]