I have a file (main.lst) containing a list of dates in DDMMYYYY format. The dates will mostly be the same but it is possible to have multiple dates and these need not be in chronological order. I have another file containing another list of dates (holidays.lst).
The task is to get the latest date from main.lst. Check if that day is a Sunday or exists in "holidays.lst". If yes, I need to add 1 to the date and perform the above check again. This loop will break once I get a date (procdate) which is neither a Sunday nor a holiday.
Then, I need to add 1 to the "procdate" and perform the above check again. This will yield the final date (finaldate).This is a separate loop having an exit condition similar to the previous loop.
E.g., if procdate from loop 1 happens to be Saturday, then finaldate ought to be Monday (assuming that that particular Monday is not in holidays.lst).
I am using ksh on AIX 5.3 with perl 5.8.8 installed.
Any pointers to the date arithmetic highly appreciated.