From b3972a88d1c3c3414d6c6bb31dd8ce13dd4d76d5 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Fri, 8 Feb 2013 09:24:18 +0000 Subject: [PATCH] do-slaves: Rewrite output path to prevent buffering of stderr. Organization: Straylight/Edgeware From: Mark Wooding --- do-slaves | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/do-slaves b/do-slaves index de31424..000ded6 100755 --- a/do-slaves +++ b/do-slaves @@ -17,7 +17,8 @@ slaves=$(expand-list /etc/slaves "$@") for i in $slaves; do { { { echo "starting..." set +e; ssh "$i" "$command" 3>&-; rc=$?; set -e - echo "done (rc = $rc)"; } >&3; } 2>&1 | sed 's/^/!!! /'; } 3>&1 | - sed "s^$i: " & + echo "done (rc = $rc)"; } >&3; } 2>&1 | + while IFS= read line; do echo "!!! $line"; done; } 3>&1 | + while IFS= read line; do echo "$i: $line"; done & done wait -- [mdw]