There is a shell script:
#!/bin/bash
python3 do_something_1.py
python3 do_something_2.py
python3 do_something_3.py
python3 do_something_4.py
python3 do_something_5.py
If it's running python3 do_something_3.py
now.
How can I tell bash process that after python3 do_something_3.py
exits by itself(don't kill subprocess, wait it), no longer run subsequent commands python3 do_something_4.py
,python3 do_something_5.py
anymore?
python3 do_something_3.py && exit 0
?python3 do_something_3.py
failed of succeed out of your script (you may only can verify if it had given output as you were expected then go ahead and kill your running script), other than that you needed error handling in your script beforehand.python3 do_something_3.py
subprocess normally exit (don't send signal to kill the subprocess), once the child process exits, skip the subsequent commands like 4.py & 5.py .