From 7268ae55949b971bac7818f932a04dd2435fb91b Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sun, 24 Jul 2022 22:39:27 -0600 Subject: [PATCH] jobs --- functions/update_apps.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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