From 1b89f902302038a39d4a763ec7d39aeef2d15bff Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sun, 24 Jul 2022 22:23:57 -0600 Subject: [PATCH] wait --- functions/update_apps.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index 8b4f3431..5284beab 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -12,6 +12,7 @@ count=0 do update_apps "$i" & (( count++ )) + processes+=($!) while [[ "$count" -ge "$update_limit" ]] do echo "waiting for free space" @@ -19,6 +20,12 @@ count=0 count=0 done done + +for proc in "${processes[@]}" +do + wait "$proc" +done + } export -f commander