获取一段时间的日期(可用于生成文件目录等场景)
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