i am manipulating the date in a unix script as follows:
if [ $Day != 1 ]
then
Month=$(($Month + 1)) && Day=1
if [ $Month = 12 ]
then
Month=1 && Year=$(($Year + 1))
fi
fi
however i want to prefix the result to a filename, however it does not include zeros
eg 20020301 (1st march 2002) would be 200231
can anyone suggest a way to include the 0's
if [ $Day != 1 ]
then
Month=$(($Month + 1)) && Day=1
if [ $Month = 12 ]
then
Month=1 && Year=$(($Year + 1))
fi
fi
however i want to prefix the result to a filename, however it does not include zeros
eg 20020301 (1st march 2002) would be 200231
can anyone suggest a way to include the 0's