Just a gentle reminder to go have a nice day at the park this July 4th ;)
(We won't have another Saturday July 4th for 11 years)

rld@Intrepid:~$ for x in {1970..2099}; do cal july $x |grep -q "^ *1 2 3 4 *$" && echo $x; done 1970 1981 1987 1992 1998 2009 2015 2020 2026 2037 2043 2048 2054 2065 2071 2076 2082 2093 2099 rld@Intrepid:~$

#Chicago #SaturdayInThePark

cc: @amin

P.S., interestingly, it follows a repeating pattern of 11, 6, 5, 6:

rld@Intrepid:~$ y=0; for x in 1970 1981 1987 1992 1998 2009 2015 2020 2026 2037 2043 2048 2054 2065 2071 2076 2082 2093 2099; do ((y!=0)) && echo $((x-y)); y=$x; done 11 6 5 6 11 6 5 6 11 6 5 6 11 6 5 6 11 6 rld@Intrepid:~$

It seems that's the pattern for all repeating calendars. I tried the same with January, and it had the same pattern.

@rl_dane

Can simplify the grep to

… | grep -q ' 4 *$'

since Saturday is the last day in the default cal(1) output 😉

And the 11/6/5/6 pattern _should_ hold until the next time we cross a century boundary when we hit the next exception to Leap Year.

@gumnos

> Can simplify the grep to
>
> … | grep -q ' 4 *$'

Ah, so right!

> And the 11/6/5/6 pattern should hold until the next time we cross a century boundary when we hit the next exception to Leap Year.

Interesting! Well, I doubt I'll have to worry about that one. XD
Some of the younger fediversians might!

@rl_dane

color me irrationally grumpy at the fact cal(1) emits extra spaces at the end of the line, when '␣4$' **should** have been sufficient 😆

@gumnos

26 years of grepping has taught me to always add [[:space:]]* (or at least *) after every ^ and before every $ ;)