#!/bin/bash
date
bash -c "sleep 7" &
bash -c "sleep 5" &
wait
date
As you can see while running this script, both sleep commands will run in parallel, but main thread stalls, while they are running.
Sat. Jule 27 01:11:49 2013
Sat. Jule 27 01:11:56 2013
Replace sleep 7
with expect launchneuron.exp
and sleep 5
with expect launchmpj.exp
and add your plot commands after calling "wait"
:
echo "Simulation Complete"
...(your code to plot results)