From a245ca56761340007598508ce142c79b7812dd25 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Fri, 1 Feb 2019 11:33:19 -0500 Subject: [PATCH] print-failed-test-output: minor improvements Drop the subshell used to create the string of dashes (and rename the variable to "sep" at the same time). Replace $(cat file) with the equivalent but faster $(< file). --- print-failed-test-output | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print-failed-test-output b/print-failed-test-output index 68fa9ee..d0d63aa 100644 --- a/print-failed-test-output +++ b/print-failed-test-output @@ -3,11 +3,11 @@ shopt -s failglob # Print output from failing tests -dashes=$(printf "%80s" '' | tr ' ' '-') +printf -v sep "%0.s-" {1..80} for exit_file in t/test-results/*.exit; do - [ "$(cat "$exit_file")" -eq 0 ] && continue + [ "$(< "$exit_file")" -eq 0 ] && continue out_file="${exit_file%exit}out" - printf '\n%s\n%s\n%s\n' "$dashes" "$out_file" "$dashes" + printf '\n%s\n%s\n%s\n' "$sep" "$out_file" "$sep" cat "$out_file" done exit 1