Just for fun, how many combinations of months are there where Friday falls on the 13th? This one-liner will print out a table of month combinations along with the years for a given range.
for y in {2000..2050};do for m in {1..12};do cal $m $y|awk 'FNR==1{m=$0}/^ 1/{print m}';done;done|awk '{a[$2]=a[$2]" "$1}END{for (i in a) print i,a[i]}'|awk '{t=$1;$1="";a[$0]=a[$0]" "t}END{for (i in a) printf "%-24s %s\n",i,a[i]}'
This is the sample output for the given range. I’ve rearranged the lines to put the leap year patterns at the end. If you survive this Friday the 13th, the next one is in July.. Good Luck!!
January October 2006 2017 2023 2034 2045 February March November 2009 2015 2026 2037 2043 June 2003 2008 2014 2025 2031 2036 2042 September December 2002 2013 2019 2024 2030 2041 2047 April July 2001 2007 2018 2029 2035 2046 May 2005 2011 2016 2022 2033 2039 2044 2050 August 2010 2021 2027 2038 2049 February August 2004 2032 January April July 2012 2040 October 2000 2028 March November 2020 2048
Making it a bit more readable..
for y in {2000..2050}; do for m in {1..12}; do cal $m $y | awk 'FNR==1{m=$0}/^ 1/{print m}' done done | awk '{a[$2]=a[$2]" "$1}END{for (i in a) print i,a[i]}' | awk '{t=$1;$1="";a[$0]=a[$0]" "t}END{for (i in a) printf "%-24s %s\n",i,a[i]}'