I have the same problem in this link, but the problem is I want to automate this process in an executable file, without the need to kill first PIDs every time. in fact, I want my executable file to detect these PIDs each time, and then kill them if necessary.
Do you have any idea how to do so?
11 Answer
Bash script I wrote for me when I had this problem:
#!/bin/bash
kill_args=$(pgrep gphoto) if [-z $kill_args]; then echo "Arguments are:: $( pgrep gphoto )" pgrep gphoto | xargs kill else echo "No gphoto process" fiThis script Kills all active gphoto processes. I am uncertain if that will help in you bcase.
0