created: 2019-06-03T09:01:44.000Z

直近1週間の日付をdate形式で取得する

seqとdate(mac上で作業しているのでgnu-date)を使う

$ seq -7 0 | xargs -I{} gdate -d+{}days +'%Y-%m-%d'
2019-05-27
2019-05-28
2019-05-29
2019-05-30
2019-05-31
2019-06-01
2019-06-02
2019-06-03

こんな感じで

mycommand --date 2019-05-27
mycommand --date 2019-05-28
mycommand --date 2019-05-29
mycommand --date 2019-05-30
mycommand --date 2019-05-31
mycommand --date 2019-06-01
mycommand --date 2019-06-02
mycommand --date 2019-06-03

参考

すぐわかる代数
[ad] すぐわかる代数
石村 園子 (単行本)