Try
# ps -ef | grep [s]endmail
instead. Should do what you want (does for me anyway).
Adding the brackets like you've shown seems to do the trick.
Well, in a shell, $$ is the PID. If you can capture your process PID
when it starts, you simply write it in a file in /var/run/ and when
you stop, you issue a "kill -9 $(</var/run/pidfile)".
$$ is the pid of the actual shell, not the process I'm trying to find or
kill, unless knowing that pid somehow leads me to the pid I'm looking
for?
Either way, adding the brackets seems to fix my immediate problem.
Thanks,
James