From: Mark Wooding Date: Fri, 8 Feb 2013 09:24:18 +0000 (+0000) Subject: do-slaves: Rewrite output path to prevent buffering of stderr. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-bits/commitdiff_plain/b3972a88d1c3c3414d6c6bb31dd8ce13dd4d76d5 do-slaves: Rewrite output path to prevent buffering of stderr. --- 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