Quote:
Originally Posted by joeyg
Code:
if [[ $month -eq 0 ]] ; then
let year=$year-1
let month=1
fi
Shouldn't this be ?
Code:
if [[ $month -eq 0 ]] ; then
let year=$year-1
let month=12
fi
January is month 1, so when you subtract 1 you get 0. And you rightly trap for it, decrementing the year but setting the month to 1 for January. I think you should set to 12 for December.
|
You are right. I was being bombed with other things when I did that... my bad.