Skip to content

Instantly share code, notes, and snippets.

View paulcarroll's full-sized avatar

Paul Carroll paulcarroll

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