linux - Fetching pid and using it for kill -
i have batch file in linux (which execute externally within lazarus application). should read process pid, store in variable, , use variable execute "kill" command.
this how i'm doing it:
pid=`pidof myprocess` kill $pid
however, kill command fails ": arguments must process or job ids" error.
how can achieve this?
perhaps using pkill
directly better suit needs.
pkill myprocess
more info on pkill here: https://www.lifewire.com/list-and-kill-processes-using-the-pgrep-and-pkill-4065112
Comments
Post a Comment