Today is Remembrance Day in Canada, a day to remember the sacrifices made by our citizens in current and past wars. Here at Seneca we’ll all be observing two minutes of silence at 11am. A very somber day indeed.
But this day is special in another sense and I don’t mean to be frivolous – it’s just that by nature I’m a curious fellow and often get sidetracked by sometimes very trivial ideas. Case in point, today is Remembrance Day but it’s also Seneca’s employee pay day. So why is this special? Well, it turns out that banks in Canada are closed on Remembrance Day so Seneca deposited our pay into our bank accounts yesterday – one day early. Ok, so big deal. Well for me it is a big deal because I couldn’t remember this happening in the past – and I’ve been here a long time. So I started thinking. When was the last time Remembrance Day fell on Seneca’s pay day? And when will it happen again?
It turns out that these questions can be answered with a simple BASH script. For example, to find out when this collision of dates happened in the past I wrote this script:
#!/bin/bash
echo Hit CTRL-C to quit
x=2
while :
do
d=$(date -d"$x weeks ago")
echo $d | grep "Thu Nov 11"
((x+=2))
done
Now, when I ran this script, here’s what I got:
Hit CTRL-C to quit
Thu Nov 11 05:47:25 EST 1999
Thu Nov 11 05:47:27 EST 1976
Thu Nov 11 05:47:27 EST 1965
Thu Nov 11 05:47:28 EST 1954
Thu Nov 11 06:47:29 EWT 1943
Thu Nov 11 05:47:30 EST 1920
Thu Nov 11 05:47:31 EST 1909
Thu Nov 11 05:47:32 EST 1897
Thu Nov 11 05:47:32 LMT 1886
Thu Nov 11 05:47:33 LMT 1875
^C
So, it seems the last time our pay day fell on Remembrance Day was in 1999. Before that it happened in 1976.
Looking into the future, I ran this script:
#!/bin/bash
echo Hit CTRL-C to quit
x=2
while :
do
d=$(date -d"$x week")
echo $d | grep "Thu Nov 11"
((x+=2))
done
And the output I got was
Hit CTRL-C to quit
Thu Nov 11 06:24:00 EST 2021
Thu Nov 11 06:24:00 EST 2032
Thu Nov 11 06:24:02 EST 2055
Thu Nov 11 06:24:03 EST 2066
Thu Nov 11 06:24:03 EST 2077
Thu Nov 11 06:24:04 EST 2088
Thu Nov 11 06:24:05 EST 2100
Thu Nov 11 06:24:07 EST 2123
Thu Nov 11 06:24:07 EST 2134
^C
So the next time Remembrance Day will collide with Seneca’s pay day will be in the year 2021. Of course I’ll be retired by then … I hope.
Anyway, take some time today to reflect on the fact that the freedom we enjoy in Canada today is due in no small measure to the sacrifices of those who came before us, and when you go home tonight – practice your shell programming.