zeek/auxil/btest/testing/Scripts/script-command
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

15 lines
438 B
Plaintext
Executable File

# This is a wrapper for the "script" command, which has different options
# depending on the OS. "script" can have side-effects on the current terminal
# when invoked, breaking some carriage returns. Closing its stdin seems to
# prevent that.
true | {
if ! script -q -c ls /dev/null >/dev/null 2>&1; then
# FreeBSD and macOS
script -q /dev/null $@
else
# Linux
script -qfc "$@" /dev/null
fi
}