To automate simulations I created a single bash script (see below) running 3 python programs in parallel, interconnected with sockets, each in a new terminal (The behavior of the software requires the 3 subprograms to be ran in separate terminals).
#!/bin/bash
gnome-terminal -- ./orchestrator.py -c config/orchestrator/configWorstCaseRandomV.yml -v
gnome-terminal -- ./server.py -c config/server/config.yml -s config/server/systems/ault14mix.yml --simulate -v
gnome-terminal -- ./simulation/traces/simulate_traces.py -m September
What I want to do is to re-execute the same 3 pythons programs but with different parameters ONLY after the 3 previous programs have ended. But here the 3 programs are started at the same time and I have no way of knowing when then end in my bash script.
I tried to simply add the corresponding commands at the end of my script, but logically it doesn't wait for the previous simulation to be completed to start the next 3 programs.
So my question is, is there a way of knowing when a program is ended in another terminal before executing the next lines of a bash script ?
gnome-terminal?./orchestrator.py ... &). The third can just be run in your current terminal, and after it exits, you can kill the orchestrator and server and start again.