Skip to content

Instantly share code, notes, and snippets.

@T1T4N
Last active December 7, 2020 15:01
Show Gist options
  • Save T1T4N/780e880115ac0702549d72f2ac78020e to your computer and use it in GitHub Desktop.
Save T1T4N/780e880115ac0702549d72f2ac78020e to your computer and use it in GitHub Desktop.
Bash redirect output to syslog
# As the first command in a script
exec 1> >(logger -is -t "$(basename "$0")") 2>&1
# Alternatively, output everything to a file
#exec 1> "$PWD/out.log" 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment