Re: Not quite the end of the month....
I was once handed a shell script by a retiring co-worker with the airy "there's some sort of bug that happens only once in a blue moon and shuts down the process, but I've never been able to find it".
The date was used to build filenames that would be found on the system and needed to be processed. On rare occasions the script couldn't find the files and they had to be managed manually, apparently.
Sometimes the date on the files to be found was for "yesterday", but the script could deal with that I was told.
So I took a look. Ahem:
The quickest fix for this "bug" was to pen a quick perl script called yesterday.pl which did all the stuff you have to do to figure out yesterday's date from today's and replace the second line with :
My bosses (I have several) couldn't see why I had "made things complicated with perl". I explained that the alternative was lobbying the government to add January the notghingth, July zeroth and August the zipst to the calendar, and perl was faster.