shell的脚本循环处理
#! /bin/sh
today="20151014"
enddate="20151001"
while [[ $today -ge $enddate ]]
do
echo ${today}
today=`date -d "-1 day $today" +%Y%m%d`
done
循环日期处理,得到20151001到20151014之间的日期。
shell的脚本循环处理
#! /bin/sh
today="20151014"
enddate="20151001"
while [[ $today -ge $enddate ]]
do
echo ${today}
today=`date -d "-1 day $today" +%Y%m%d`
done