Fedora version: Fedora WS 34
Shell : bash
I have 5 commands which I want to execute in parallel in the bash shell. So, I can run it in the background by adding an
& at the end of each command like below
command1 & command2 & command3 & command4 & command5 &
I remember reading in the stack exchange that, in such a scenario, it is recommended to add a
wait command in the end as shown below. I don’t have the URL for that post now.
But, I would like to know why is it good to have the
wait builtin/command added at the end in this scenario. Anyone has any idea ?
command1 & command2 & command3 & command4 & command5 & wait