I've a process name and I've to send a
signal to that process but I need its PID to call
. I would only like to use:
as the last thing. Is there any other way to find out the process' PID? One way I could think of is to send a socket request to that process and ask to its PID.
The other way is a little too complicated for a simple code I'm writing: to do what pidof command's source code
is actually doing (it uses a function call
but that's doing a lot of things).
If no simple solution is possible, I've to do this:
and check its return code. But will pkill be available for sure on all Linux machines?