📜  bash中的for循环日期 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:28.948000             🧑  作者: Mango

代码示例1
d=2015-01-01
while [ "$d" != 2015-02-20 ]; do 
  echo $d
  d=$(date -I -d "$d + 1 day")

  # mac option for d decl (the +1d is equivalent to + 1 day)
  # d=$(date -j -v +1d -f "%Y-%m-%d" "2020-12-12" +%Y-%m-%d)
done