begin="2016-01-01" for (( i = 0; i < 21; i++ )); do current=$(date -d "$i day $begin" +"%Y-%m-%d") echo $current done
begin="2016-01-01" begin=`date -j -f %Y-%m-%d $begin +%s` for (( i = 0; i < 21; i++ )); do current=`date -r $(expr $begin + $i \* 86400) +"%Y-%m-%d"` echo $current done