Inspired by this blog post by Tim Ferriss and the letter “On the shortness of life” by Lucius Seneca contained therein, I created a “death stats” script to help remind me to make good use of the time that I have left.
Of course, I could die in a car accident any day, but we have to think of these things practically and probabilistically.
The script runs in Bash — you’ll need a
Mac or Linux machine, or Cygwin on Windows I suppose, in order to run it. I have it running on my webserver and emailing me each morning via a cron job. The math should be pretty self-explanatory, and you could easily add your own metrics. Note that I’ve changed my exact birth date for the posted script here, since in some situations that could be considered confidential information.
The estimated death date I got using the “Normal” mode of the Death Clock.
SECONDSLEFT=$((`date -d $DEATHDATE "+%s"`-`date "+%s"`))
SECONDSTOTAL=$((`date -d $DEATHDATE "+%s"`-`date -d $BIRTHDATE "+%s"`))
# There's probably a nicer way to format the percentage but this works
PCTOVER=`echo "scale=2; (($SECONDSTOTAL - $SECONDSLEFT) / $SECONDSTOTAL)*100" | bc | sed "s/\.00//"`
DAYSLEFT=$(($SECONDSLEFT / $SECONDSPERDAY))
YEARSLEFT=$(($DAYSLEFT / $DAYSPERYEAR))
echo "Percent Over: $PCTOVER"
echo "Days Left: $DAYSLEFT"
echo "Years Left: $YEARSLEFT"
The output looks like this (the numbers are made up):
Percent Over: 29
Days Left: 19002
Years Left: 51
I do hope and think it reasonably likely that Ray Kurzweil is right, and that my life could be substantially extended, but I’m not counting on it, and I don’t think I should — it would kind of defeat the purpose here. Read the letter by Seneca in Tim Ferriss’ post to see what I mean.
Suggestions for improvements to the script are welcome.
NB: This doesn’t work on OS X, because the
date command is different.