a73x

tools/run-logged.sh

Ref:   Size: 253 B   History

#!/bin/sh
# Preserve the command's status while keeping noisy gate output reviewable.
set -u
[ "$#" -ge 2 ] || { echo 'usage: run-logged.sh LOG COMMAND [ARG ...]' >&2; exit 2; }
log=$1
shift
"$@" > "$log" 2>&1
result=$?
tail -n 30 "$log"
exit "$result"