scripts/arch-run: print stderr immediately
PATCH v2 1/1 scripts/arch-run: print stderr immediately
Not doing so hid stderr output when the test was stuck and subsequently killed with ^C.
Signed-off-by Radim Krčmář <[email protected]>
---
v2: use /dev/... files instead of &${file descriptor numbers} [Paolo]
--- scripts/arch-run.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/arch-run.bash +1 -2
@@ -30,12 +30,11 @@ run_qemu () # stdout to {stdout}, stderr to $errors exec {stdout}>&1 - errors=$("${@}" 2>&1 1>&${stdout}) + errors=$("${@}" 2> >(tee /dev/stderr) > /dev/fd/$stdout) ret=$? exec {stdout}>&- if [ "$errors" ]; then - printf "%s\n" "$errors" >&2 sig=$(grep 'terminating on signal' <<<"$errors") if [ "$sig" ]; then sig=$(sed 's/.*terminating on signal \([0-9][0-9]*\).*/\1/' <<<"$sig")
Signature · 1 line
2.10.2
Paolo Bonzini
maintainerQuoted 1 line · Radim Krčmář
# stdout to {stdout}, stderr to $errors"stderr to $errors and stderr"
Please make the change and commit it, no need for v3!
Thanks,
Paolo
Quoted 8 lines
scripts/arch-run.bash +1
-2exec {stdout}>&1 - errors=$("${@}" 2>&1 1>&${stdout}) + errors=$("${@}" 2> >(tee /dev/stderr) > /dev/fd/$stdout) ret=$? exec {stdout}>&- if [ "$errors" ]; then - printf "%s\n" "$errors" >&2
2016-11-15 15:47+0100, Paolo Bonzini:
Quoted 6 lines · Radim Krčmář
Quoted 1 line
# stdout to {stdout}, stderr to $errors"stderr to $errors and stderr"
Please make the change and commit it, no need for v3!
Bloody comments, thanks!