Skip to content

Instantly share code, notes, and snippets.

@cspotcode
Created October 3, 2017 19:20
Show Gist options
  • Save cspotcode/e010403fd21363591cdcfe812dea5b47 to your computer and use it in GitHub Desktop.
Save cspotcode/e010403fd21363591cdcfe812dea5b47 to your computer and use it in GitHub Desktop.
Logging all bash script output
#!/bin/bash -x
exec > /tmp/transcript.log 2>&1
# This trick means the bash scripts logs its entire execution,
# both the commands executed and the output of those commands,
# to the transcript file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment