I want to use yesterday's date in a script. I.E. If today is 4/1/2003, I want to use 033103.
I was using the example below, but it won't work because it tries to subtract 1 from 1 which results in a 0, but I want 0331.
D=`date +%d`
D=$(($D - 1))
M=`date +%m`
Y=`date +%y`
DATE=$M$D$Y
Does anyone have any ideas as to how I can do this?
Thanks,
John
I was using the example below, but it won't work because it tries to subtract 1 from 1 which results in a 0, but I want 0331.
D=`date +%d`
D=$(($D - 1))
M=`date +%m`
Y=`date +%y`
DATE=$M$D$Y
Does anyone have any ideas as to how I can do this?
Thanks,
John