Won't it break when one of the commands returns non-zero? I think you can replace the & with ;
& is for backgrounding:
#!/bin/sh
date
sleep 5 & # forks the command into the background, we proceed immediately
date
wait # pauses until the backgrounded sleep returns
date
has output Fri Apr 14 13:17:00 PDT 2023
Fri Apr 14 13:17:00 PDT 2023
Fri Apr 14 13:17:05 PDT 2023 { git clone ... ; cd "$1"; ./configure; make; make install } &
to run the group command (I had to look up the term in man bash) all in the background.Using group commands can be kind of weird though because they're run in the environment of the running shell, so
% mkdir -p /tmp/foo && cd /tmp/foo && pwd
/tmp/foo
% { mkdir bar; cd bar; echo $BASH_SUBSHELL ; }
0
% pwd
/tmp/foo/bar
but if you do the group command in the background, bash runs it in a subshell[0] and the current directory for your shell doesn't change: % mkdir -p /tmp/foo && cd /tmp/foo && pwd
/tmp/foo
% { mkdir bar; cd bar; echo $BASH_SUBSHELL ; } &
1
% pwd
/tmp/foo
[0] From man bash: If a command is terminated by the control operator &, the shell executes the command in the background in a subshell.& detaches them essentially running them in parallel?
Second because there's no `-e`.