shell脚本获得当前日期前一个月的日期
发布日期:2021-05-10 15:51:50 浏览次数:12 分类:精选文章

本文共 1246 字,大约阅读时间需要 4 分钟。

# ������������������preMonth() {    sav_months=`echo $2`    year=`echo $1|cut -c 1-4`    month=`echo $1 | cut -c 5-6`    mm=`echo "$sav_months + 1"|bc`    if [ $month -lt $mm ]; then        month=`expr $month + 12 - $sav_months`        year=`expr $year - 1 `    else        month=`expr $month - $sav_months`    fi    DATE=`printf "%04s%02s" $year $month`    return $DATE}DATE=`date +%C%y\%m`preMonth $DATE 1gzipdate=`echo $DATE | sed s/[^0-9]//g`# ������������������������cd /jsdata001/BWSP/${DATE}_origin/odsftp -n 135.222.24.18 << _EOF_quote USER jsxxquote PASS zhjxxbinpromget js${gzipdate}01.txt_EOF_# ������������������get js${gzipdate}01.txt

������������������ Unix/Linux ������������������������������������������������������������������������������������������

  • ��������������������������� shell ���������������������������������������������������������������������������������������������������������������������

  • ��������������������������� ftp ������������������������������������������������������������������������������������������������������������������

  • ���������������������������������������������������������������������

  • ������������������������������������������������������������������������������������������������������������

    上一篇:oracle 12c rac管理命令梳理
    下一篇:C++的文件解析

    发表评论

    最新留言

    网站不错 人气很旺了 加油
    [***.192.178.218]2025年04月13日 23时01分42秒