命令如下:
date +"%Y%m%d" --date="-1 day"
循环:
for((i=127;i>100;i--)) do year=`date +"%Y" --date="-${i} day"` month=`date +"%m" --date="-${i} day"` day=`date +"%d" --date="-${i} day"` bash -x script/some.sh ${year} ${month} ${day} done
命令如下:
date +"%Y%m%d" --date="-1 day"
循环:
for((i=127;i>100;i--)) do year=`date +"%Y" --date="-${i} day"` month=`date +"%m" --date="-${i} day"` day=`date +"%d" --date="-${i} day"` bash -x script/some.sh ${year} ${month} ${day} done