jmquintana79
9/1/2017 - 7:01 AM

Build a date sequence with bash.

Build a date sequence with bash.

#!/bin/bash

for i in `seq 0 10`;
do
  date -d "2014-02-01 $i days" +%Y-%m-%d;
done;

# out:
# 2014-02-01
# 2014-02-02
# 2014-02-03
# 2014-02-04
# 2014-02-05
# 2014-02-06
# 2014-02-07
# 2014-02-08
# 2014-02-09
# 2014-02-10
# 2014-02-11