示例:
#!/bin/bash start_sec=`date -d "$1" "+%s"` end_sec=`date -d "$2" "+%s"` for((i=start_sec;i<=end_sec;i+=86400)); do day=$(date -d "@$i" "+%Y%m%d") echo $day done
示例:
#!/bin/bash start_sec=`date -d "$1" "+%s"` end_sec=`date -d "$2" "+%s"` for((i=start_sec;i<=end_sec;i+=86400)); do day=$(date -d "@$i" "+%Y%m%d") echo $day done