Skip to content

Instantly share code, notes, and snippets.

View treefitty's full-sized avatar

Paul Carroll treefitty

View GitHub Profile
@treefitty
treefitty / 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