shell脚本生成一个时间段的日期
示例:
#!/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
posted on 2021-03-29 15:25 RICH-ATONE 阅读(506) 评论(0) 编辑 收藏 举报
示例:
#!/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
posted on 2021-03-29 15:25 RICH-ATONE 阅读(506) 评论(0) 编辑 收藏 举报