mtimeout.c: Fix ludicrous whitespace in help message.
[misc] / hush.in
diff --git a/hush.in b/hush.in
index 0ecc48e..d5aebcb 100755 (executable)
--- a/hush.in
+++ b/hush.in
@@ -145,11 +145,12 @@ EOF
 ## stage of a pipeline, where we actually wanted the status of the first.  So
 ## we write that to another pipe (fd 5) and pick it out using command
 ## substitution.
+copy () { while IFS= read -r line; do printf "%s %s\n" "$1" "$line"; done; }
 rc=$(
-  { { { { set +e; $lbuf "$cmd" "$@"; echo $? >&5; } |
-       while read line; do echo "| $line"; done >&4; } 2>&1 |
-      while read line; do echo "* $line"; done >&4; } 4>&1 |
-    cat >&3; } 5>&1 </dev/null
+  { { { { set +e; $lbuf "$cmd" "$@" 3>&- 4>&- 5>&-; echo $? >&5; } |
+       copy "|" >&4; } 2>&1 |
+      copy "*" >&4; } 4>&1 |
+    cat -u >&3; } 5>&1 </dev/null
 )
 
 ## Write the log trailer.