0

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?

Nima
  • 1
  • 1
  • 1
    Probably best to clarify your problem in its entirety rather than just post a link to a similar problem - it'll be easier for people to see what your issue is without having to visit more than one page. – Will Nov 16 '21 at 13:04

1 Answers1

0

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"
  fi

This script Kills all active gphoto processes. I am uncertain if that will help in you bcase.

miksolo
  • 11
  • 3