0

so here is my test.sh :

#!/bin/sh

python test.py & 
test_PID=$!
python test2.py & 
test2_PID=$!
python test3.py & 
test3_PID=$!

sleep 10


kill -15 $test_PID
kill -15 $test2_PID
kill -15 $test3_PID

so the three python scripts writes in three files data in the same time and after 10 seconds i kill them but sometimes i don't find data in text files and sometimes and just find data in one of the three files, Without the kill instruction below ,it writes fine to the three files but never stops and with the kill it stops after 10s but don't write in files. How to kill it after 10 seconds and still the script python does its job by writing into the file ?

0 Answers0