chiark / gitweb /
do-slaves: Rewrite output path to prevent buffering of stderr.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 Feb 2013 09:24:18 +0000 (09:24 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Feb 2013 09:24:18 +0000 (09:24 +0000)
do-slaves

index de3142413f7486e91ad9b7ff5051808898b5d4f0..000ded665ed4e0be517326eaf1a929ab84b0df9e 100755 (executable)
--- 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
 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\a^\a$i: \a" &
+       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
 done
 wait