BASH Monitoreo de trabajos de fondo

#!/bin/bash

# when running "some commands" in the background in your script with '&' 
# and want to wait until they are finished, 
# you can check the number of background jobs in a loop with the jobs command

while [[ $(jobs -r | wc -l) -gt 0 ]]; do
sleep 1
done
Helpful Hawk