遍历日期的Linux Shell脚本
#! /bin/bash
date=$1
eddt=$2
while [ $date -le $eddt ];
do
echo $date
date=$(date -d "${date}+1days" +%Y%m%d)
done
测试结果如下:
$ bash test.sh 20180721 20180805
20180721
20180722
20180723
20180724
20180725
20180726
20180727
20180728
20180729
20180730
20180731
20180801
20180802
20180803
20180804
20180805