diff --git a/functions/update_apps.sh b/functions/update_apps.sh index b91cb9b6..d02ea7c5 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -15,9 +15,11 @@ count=0 processes+=($!) while [[ "$count" -ge "$update_limit" ]] do + jobs -p + pidcount=0 echo "waiting for free space" - wait -n "${processes[@]}" - (( count-- )) + wait -n "${processes[pidcount]}" && (( count-- )) + (( pidcount ++ )) done done