循环获取日期的shell脚本

#!/bin/bash

now_date=`date +%Y-%m-%d`

start_date=`date -d "2019-08-01" +%Y-%m-%d`

start_second=`date $start_date +%s`
now_second=`date $now_date +%s`


while (( $start_second<$now_second ))
do
    start_date=`date -d "$start_date 1 month" +%Y-%m-%d`
    echo $start_date
    
    start_second=`date $start_date +%s`
done

你可能感兴趣的:(循环获取日期的shell脚本)