Korn Shell Newbie Scripter: Date arithmetic
Posted on 1999-01-05
I am writing a korn shell script that takes in the date in the form of YYYY MM DD as parameters. I need to do a check so that the date entered is no more than three days before the current date, or no later than the current date.
The minimum information I need is how to calculate the date of three days before today, and then format it to '*%Y %m %d' and compare it to the input.
My ideal situation would be for someone out there to write a test that takes the input, makes sure it falls within the boundaries, and ensures that the input is formatted to YYYY MM DD.