获取一段时间的日期(可用于生成文件目录等场景)
i=0
until [[ $day == "2021-01-29" ]]
do
day=$(date -d "2020-11-04 $i days" +%Y-%m-%d)
echo $day
((i++))
done
输出:
2020-11-04 2021-11-05 ... 2021-01-29
标签:11,shell,变量,04,29,01,时间段,2021,day
来源: https://www.cnblogs.com/lindaguanren/p/15737540.html