Skip to content

Instantly share code, notes, and snippets.

@jarvist
Created May 9, 2013 08:04
Show Gist options
  • Save jarvist/5546170 to your computer and use it in GitHub Desktop.
Save jarvist/5546170 to your computer and use it in GitHub Desktop.
A few lines that have sat at the end of my .bashrc for the last few years. Originally this warned me when my PhD was ending + the date I needed to submit my thesis, and as I passed into PostDoc purgatory, I use it to remind me how long I have till the end of the next contract. As a bonus, it works correctly once you've passed the deadline, infor…
theend=` date --date "30 December 2013 17:00" +%s `
now=` date +%s `
diff=` expr $theend - $now `
echo "Really Unemployed in: " `expr $diff / 86400` days `expr \( $diff % 86400 \) / 3600` hours `expr \( \( $diff % 86400 \) % 3600 \) / 60` minutes `expr $diff % 60` seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment