I have a very simple .sh script to kill a process. The processes saves its PID to pid2.txt.
pkill -e -P $(cat pid2.txt)
When I run this as sudo ./myscript.sh from the command line it works fine....
Yes, I've tried all the basic kill, pkill, etc. methods that come up with a Google search.
Sometimes it works, other times it seems something is preventing the process from terminating.
There is no ...