Created
October 3, 2017 19:20
-
-
Save cspotcode/e010403fd21363591cdcfe812dea5b47 to your computer and use it in GitHub Desktop.
Logging all bash script output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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