.
I have a simple bash script where i run 3 at the same time and when they are done they start with the next 3 like this:
command1 &
command2 &
command3 &
wait
command4 &
command5 &
command6 &
exit
But how can i do so i always run 3 of these at the same time and not wait for the other three? lets say command1 and command2 finished but command3 still runnin, then i want command4 and command5 to start so there is always 3 commands running.
Thanks