Skip to content

Commit

Permalink
mac-exec: wait for background jobs to complete
Browse files Browse the repository at this point in the history
Co-Authored-By: Jörg Thalheim <[email protected]>
Co-Authored-By: Vladimír Čunát <[email protected]>
  • Loading branch information
3 people committed Dec 19, 2024
1 parent 42cc19d commit 63ea54b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions macs/mac-exec
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ HOSTS=(
"[email protected]"
"[email protected]"
)
PIDS=()

for host in "${HOSTS[@]}"; do
# shellcheck disable=SC2068
(ssh "${host}" -- $@ 2>&1| sed -e "s/^/${host} | /") &
PIDS+=($!)
done

wait "${PIDS[@]}"

0 comments on commit 63ea54b

Please sign in to comment.