ç¼åèæ¬getdate.shï¼
[plain] view plain copy
#! /bin/sh
nowdate=`date +%Y%m01` #æ¬æ第ä¸å¤©
startdate=`date -d"$nowdate last month" +%Y%m%d` #ä¸ä¸ªæ第ä¸å¤©
enddate=`date -d"$nowdate last day" +%Y%m%d` #ä¸ä¸ªææåä¸å¤©
#éåä¸ä¸ªæçæ¯ä¸å¤©
while (( $startdate <= $enddate ))
do
echo $startdate
startdate=`date -d "+1 day $startdate" +%Y%m%d`
温馨提示:内容为网友见解,仅供参考