I have 2 python scripts a.py and b.py
and I want to write a bash script that will load a.py and not run b.py until a.py is done doing it’s thing.
simplistically
#!/usr/bin/env bash
python a.py
python b.py
but this is naive, a check to see if a.py is done… how do I do that?
This by default will already run one after the other.
To check that
python a.pycompleted successfully as a required condition for runningpython b.py, you can do:Conversely, attempt to run
python a.py, and ONLY run ‘python b.py’ ifpython a.pydid not terminate successfully:To run them at the same time as background processes:
(Responding to comment) – You can chain this for several commands in a row, for example: