parexec
Execute multiple commands in parallel and display output with ncurses
...Lines containing a single `-' instruct parexec to wait until all previous commands have finished before starting to execute further commands.
When sending a SIGINT to parexec (usually done when you hit CTRL-C) it will wait for currently running processes, but if they are done parexec will exit ignoring all the following commands.
When sending a SIGQUIT to parexec (usually done when you hit CTRL-\) or by sending SIGTERM to parexec (e.g. with kill parexec_pid) it will terminate the running processes immediately and exit.
After the start of parexec your shell window will be split up horizontally into NUMTHREADS sections. ...