Created
December 27, 2018 15:53
-
-
Save albertomm/ffd0239a2309c10f681b7cb83dd42789 to your computer and use it in GitHub Desktop.
Redirect all the script output to a file
This file contains hidden or 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 | |
# Log all output to a file | |
exec > >(tee -ia "$0.log") 2>&1 | |
echo "This will be logged." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment