Skip to content

Instantly share code, notes, and snippets.

@denalena
Created April 28, 2022 08:45
Show Gist options
  • Save denalena/45e8a9673084a5152222da3c3ef15824 to your computer and use it in GitHub Desktop.
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
#!/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