要计算。year=`date +%Y`month=`date +%m`if [ $month = 1 ]then year=`expr $year - 1` month=12else month=`expr $month - 1`fiif [ $month < 10 ]then month=0$monthfiYM=$year$month #这就是上个月了