#! /bin/sh
last_day=$(date -d '1 days ago' +%Y-%m-%d)
year_of_last_day=$(date -d '1 days ago' +%Y)
month_of_last_day=$(date -d '1 days ago' +%m)
start_day=$last_day
end_day=$last_day
if [ $month_of_last_day==3 ];then
   start_day="$year_of_last_day-01-01"
fi


if [ $month_of_last_day==6 ];then
   start_day="$year_of_last_day-04-01"
fi


if [ $month_of_last_day==9 ];then
   start_day="$year_of_last_day-07-01"
fi


if [ $month_of_last_day==1 ];then
   start_day="$year_of_last_day-10-01"
fi


echo $start_day
echo $end_day
Logo

更多推荐