I have a bash code like this.
while <some_condition>
do
some_script &
done
My purpose is that to get all outputs of some_script code and assign a variable. I tried to write
out=`some_script &`
but this time some_script codes did not run at same time. What can I do?
You can redirect the background commands to temp files, then
waitfor them to finish and gather the ouput back to the variable: