Home

How to log all output from a bash script

Gunar Gessner

Gunar Gessner

Feb 8, 2021

# Display commands issued and exit script on first error
set -xe
# Log commands, stdout, and stderr to LOG_FILE
exec 3>&1 1>>${LOG_FILE} 2>&1

Sign up for the newsletter


Read other stuff