#!/bin/bash #以天做循环 #sh x.sh 20170101 20170103 stime=$1 etime=$2 while : stime=$(date -d "$stime 1day" +%Y%m%d) if [[ $stime -gt $etime ]]; then break;