Loop from start date to end date in Mac OS X shell script Loop from start date to end date in Mac OS X shell script shell shell

Loop from start date to end date in Mac OS X shell script


Read your date's manpage by running man date and look at the -v option. Here is an excerpt:

-v Adjust (i.e., take the current date and display the result of the adjustment; not actually set the date) the second, minute, hour, month day, week day, month or year according to val. If val is preceded with a plus or minus sign, the date is adjusted forwards or backwards according to the remaining string, otherwise the relevant part of the date is set. The date can be adjusted as many times as required using these flags. Flags are processed in the order given.