In Unix, I want to find the date (day of month) of the last Saturday of a given month and year. I know
will give me the calendar for a given month / year. What is a good way to get the last Saturday?
Update: I'd like a solution that I could use to apply to any day of the week. For example, I could use the same method to find the date of the last Sunday or Wednesday as well.