New to shell. Need to be able to use the date function to create variables which are used to create filenames. Program is run for 'n' days ( 1 to whatever ). I need to be able to handle the change for the month/day ( 30 days hath September....blah blah). i.e. The script run for 30 days on the 1st of the month will work fine. But run for 30 days on the 20th of the month increments the var to the 49th/50th day of the month. I need a function or some idea of how to handle the month change (including leap years) without nesting a bunch of ifs.
Here's part of the script......
for z in 1 2 3 4 5 6 7 8 9 10 11 12
echo '***** '
echo scan for $DATE
DATE=`expr $DATE + 1`
TODAY=`expr $TODAY + 1`