#!/bin/sh source ~/.bash_profile; source /etc/profile; start_date="20190622" end_date="20190625" while [ "$start_date" -le "$end_date" ]; do yestertoday=`date -d "$start_date" +%Y-%m-%d` today=`date -d "$start_date+1days" +%Y-%m-%d` echo "yestertoday is $yestertoday today is $today" start_date=`date -d "$start_date+1days" +%Y%m%d` nohup hive -hiveconf yesterday=yesterday−hiveconftoday=today -f update-from-table.hql> $yestertoday-run-update.log 2&1 & done