循环获取数字或日期

2019-05-29  本文已影响0人  哪个鹿
#!/bin/bash
yesterday=`date -d 'yesterday' +%Y-%m-%d`
# 生成日期
for day in {11..15}
do
    the_day=2019-05-$day
    echo ${the_day}
    mv day=${the_day} ${the_day}
    echo "文件名修改完毕!"
done
dataPath="/data/path/"
echo ${dataPath}
for day in {1..7}
do
    theDay=`date -d "$day day ago" +%Y-%m-%d`
    echo ${theDay}
    mv day=${theDay} ${theDay}
done
echo "over!"
上一篇下一篇

猜你喜欢

热点阅读