I am writing a script to archive some log files. It will run on the first day of the month and archive the files from 2 months ago i.e on November 1st it will archive Septembers files. The file name is of the form YYMMDD01.PAZ. The script takes the current month and then subtracts 2 using expr, unfortunately the value returned is missing the leading zero. Below is an extract of the script
if [ "$SOLMON" -ge 3 -o "$SOLMON" -le 12 ]
then
COMPMON=`expr $SOLMON - 2`
Is there a way to preserve the leading zero.
Thanks
Alan
if [ "$SOLMON" -ge 3 -o "$SOLMON" -le 12 ]
then
COMPMON=`expr $SOLMON - 2`
Is there a way to preserve the leading zero.
Thanks
Alan