Skip to content
Advertisement

bash script to kill a python script after starting another same python script

I start a python script and then after some time i want to kill it. but before killing it I want to start another copy of this same script and then kill the previous one after starting new one. I want to do this in loop.

here is my code , i just need a clean way to kill scripts.I do not want to use timeouts.

JavaScript

Advertisement

Answer

You can get the PID of the first process to kill it afterwards:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement