[root@yunwei_42 ~]# cat cc.sh today=date +%Y%m%d yesterday=date +%Y%m%d --date="-1 day" tommor=date +%Y%m%d --date="+3 day" echo $yesterday echo $tommor [root@yunwei_42 ~]# sh cc.sh 20180808 20180812