Created
April 28, 2022 08:45
-
-
Save denalena/45e8a9673084a5152222da3c3ef15824 to your computer and use it in GitHub Desktop.
A quick example of how to wrap logging around an existing bash script
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 | |
set -eux | |
LOGFILE=./$(date +%F)-$1.log | |
{ | |
date | |
false | |
date | |
} > $LOGFILE 2>&1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment