proccount
This commit is contained in:
parent
9cf49ed6c3
commit
4fe1589aef
@ -11,12 +11,14 @@ count=0
|
|||||||
for i in "${array[@]}"
|
for i in "${array[@]}"
|
||||||
do
|
do
|
||||||
update_apps "$i" &
|
update_apps "$i" &
|
||||||
(( count++ ))
|
|
||||||
processes+=($!)
|
processes+=($!)
|
||||||
while [[ "$count" -ge "$update_limit" ]]
|
proc_count=0
|
||||||
|
while [[ "${#processes[@]}" -ge "$update_limit" ]]
|
||||||
do
|
do
|
||||||
echo "waiting for free space"
|
echo "waiting for free space"
|
||||||
wait -n "${processes[@]}" &> /dev/null && (( count-- ))
|
wait -n "${processes[$proc_count]}" &> /dev/null
|
||||||
|
(( proc_count++ ))
|
||||||
|
unset "processes[$proc_count]"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user