Skip to content

Instantly share code, notes, and snippets.

View paulcarroll's full-sized avatar

Paul Carroll paulcarroll

View GitHub Profile
### Keybase proof
I hereby claim:
* I am paulcarroll on github.
* I am paulcarroll (https://keybase.io/paulcarroll) on keybase.
* I have a public key ASC7HSt7as6UmbUWcs6RH1FtgowO1JiivbxA0tFAUASnXAo
To claim this, I am signing this object:
@paulcarroll
paulcarroll / gist:98626b864c846ad836cbd4cdbccb8247
Created February 1, 2019 05:46
Copies a file to another file with yesterday's date - used for a rudimentary todo history tracker when I work
# Get yesterday's date (different between Mac and Linux)
if [[ "$OSTYPE" == "darwin"* ]]; then
yesterday=`date -v-1d +%F`
else
yesterday=$(date -d "yesterday 13:00" +'%Y%m%d')
fi
# Construct the filename
dest=past-$yesterday.md