I want to do the following things:
Execute multiple shell scripts (here 2 scripts) concurrently.
Wait until both scripts finish
Backticks do not give the value returned by the command, but the output of the command. To get the return values:
#!/bin/sh ./a.sh & ./b.sh ret2=$? # get value returned by b.sh wait %1 # Wait for a.sh to finish ret1=$? # get value returned by a.sh echo "$ret1: $ret2"
If you mistated the question and do in fact want the output of the commands, you get that as well since they will both go to the stdout of the script.