linux中日期的循环方式

#!/bin/bash
startDate=20171023
endDate=20171103
startSec=`date -d "$startDate" "+%s"`
endSec=`date -d "$endDate" "+%s"`
for((i=$startSec;i<=$endSec;i+=86400))
do
    firstday=`date -d "@$i" "+%Y%m%d"`
    echo ${firstday}
    y=$[$i+86400]
    secondday=`date -d "@$y" "+%Y%m%d"`
    echo ${secondday}

  done


#!/bin/bash

#etl_arc_ih_dahord_reserve_guests.sh
v_num=10000000
for i in `seq 8 116`
do
v_start=$[$v_num*($i-1)] 
v_end=$[$v_num*$i]
v_seq=$i 
 sh -x /home/webopa/xiaoxu.yang/newdw/dbhord/reserve_guests_sqoop.sh $i $v_start $v_end >/home/webopa/xiaoxu.yang/newdw/dbhord/reserve_guests_sqoop.log
sleep 5s
done 

你可能感兴趣的:(Linux,Shell)