#!/bin/bash -eu
set -e
set -u
# temporarily accept failure with:
set +e
# or:
./bad-program || true
exec 42>log.xtrace
BASH_XTRACEFD=42
set -x
exec &> >(tee script.log)
#!/bin/bash -eu
set -e
set -u
# temporarily accept failure with:
set +e
# or:
./bad-program || true
exec 42>log.xtrace
BASH_XTRACEFD=42
set -x
exec &> >(tee script.log)