#!/usr/bin/env bash
#输入参数 1=年份 2=开始月份 3=结束月份
for i in `seq -w $2 $3`; do
#参数1为指定的年份
year=$1
echo $year
monthday=${year}${i}01
echo $monthday
#产生每月第一天
begin_date=`date --date "$monthday" +"%Y-%m-01"`
echo $begin_date
#产生每月最后一天
year=`date -d "$monthday" +"%Y"`
month=`date -d "$monthday" +"%m"`
last_day=`cal $month $year | xargs | awk '{print $NF}'`
end_date=$year-$month-$last_day
echo $end_date
echo $i
#sh cpro_wap_tu_detail_result_year.sh $begin_date $end_date $i $year
done