in reply to Re: Test for daemon
in thread Test for daemon

ps -ef | grep -v grep | grep inetd
Please, let us not cargo-cult this crazy "grep -v grep" some more. I cringe each time I see that. It's a poor solution to a common problem.

The way to avoid picking out the grep process itself is to ask ps for the proper things:

ps axc | grep inetd
If your ps doesn't have a "command-name only" solution, then simply muddy the argument so that the grep cannot match it:
ps ax | grep '[i]netd'
Let's not be wasting processes needlessly. Think before you type, people.

-- Randal L. Schwartz, Perl hacker