#! /Bin/sh
D1 = 20111201.
D2. = 20120625
Time = $ (date + % s-d ''$ D2'')-$ (date + % s-d ''$ D1 ''))); # date difference
T = 'expr $ time/100' # Number of different days
For (I = 0; I <= $ t; I = I + 1 ))
Do
# Echo $ d1
Perl XX. pl $ d1
D1 = 'date-d' $ D1 'utc 86400 seconds' + "% Y % m % d "'
Done
Note:
D1 = 'date-d' $ D1 'utc 86400 seconds' + "% Y % m % d "'
In the format of "% Y % m % d", the date of 86400 seconds after '$ D1' UTC is displayed, that is, the date of the day after D1.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lili split line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
Another method:
Startday = "20120901"
Datestr = ""
For I in 'seq 0 39 '# Time period from20120901-20121010"
Do
Datestat = 'date-d "$ startday + $ I day" "+ % Y % m % d "'
Datestr + = "/XXX/" $ {datestat }"/?? /Xxx. log. "$ {datestat }"?? "
Done
Echo "$ datestr"
Period = "20120901-20121010"
Perl baikelogstat. pl $ period $ datestr