こんなやつ。
$ ./seqdate.awk 1984-07-26 1984-08-05 1984-07-26 1984-07-27 1984-07-28 1984-07-29 1984-07-30 1984-07-31 1984-08-01 1984-08-02 1984-08-03 1984-08-04 1984-08-05
gawk が必要。
#!/usr/bin/gawk --exec # vim: et sw=4 sts=4 # YYYY-MM-DD -> unix time function parse_date(_date_string, _fields_) { split(_date_string, _fields_, "-") return mktime(sprintf("%02d %02d %02d 00 00 00", _fields_[1], _fields_[2], _fields_[3])) } # unix time -> YYYY-MM-DD function format_date(_unix_time) { return strftime("%Y-%m-%d", _unix_time) } BEGIN { if (ARGC != 3) { print "Requires 2 arguments 'from' and 'till' in YYYY-MM-DD format" > "/dev/stderr" exit(1) } from = parse_date(ARGV[1]) till = parse_date(ARGV[2]) for (t = from; t <= till; t += 86400) { print format_date(t) } }