My theory is that the "printf" command is overriding the second "if" statement.
I have tried to read through the man pages on printf, however that seems to be a bit cumbersome, does anybody know if the "printf" command is overriding my second "if" statement? If so do I have to put in another "printf" command to format the variable "$MNTH" to = 12?
Quote:
if [ $MNTH!=01 ]
then
(( MNTH=$MNTH-01 ))
MNTH=$(printf "%02d" $MNTH)
YEAR=$YEAR
else
if [ $MNTH=01 ]
then
MNTH=12
(( YEAR=$YEAR-1 ))
in red now prints out as such 00/2009
|