Got questions? Go ahead: Ask me anything!
I need to send a kill -1 to a process but I can not get the pid from a file as it's location is different on some systems
On Linux systems, that's very simple. You said your executable is "dnsmasq", so you can simply do:
killall -s 1 dnsmasq
If this isn't a Linux system or if you need the capture the PID for other reasons, do something like:
THEPID=`ps -ef|grep dnsmasq |grep -v grep`
and reference $THEPID wherever you need to.
Got something to add? Send me email.
(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version
Increase ad revenue 50-250% with Ezoic
Inexpensive and informative Apple related e-books:
Take Control of OS X Server
El Capitan: A Take Control Crash Course
Take Control of Numbers
Photos: A Take Control Crash Course
Take Control of the Mac Command Line with Terminal, Second Edition