码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本实现svn目录同步和提交

时间:2019-03-20 19:22:48      阅读:398      评论:0      收藏:0      [点我收藏+]

标签:tar   x86_64   grep   同步   done   shell脚本   shell   val   for   

 

 

 

#/bin/bash
set -x
#提交变更rpm到svn
function commit_to_svn() {
    target_svn_dir=$1
    #新增rpm至svn命令
    add_to_svn="svn st | grep ? | grep rpm | cut -c 9-"
    #删除rpm至svn命令
    del_to_svn="svn st | grep ! | grep rpm | cut -c 9-"

    subsvn_dir="rpm_x86_64_v2.1.repo rpm_x86_64_v2.1_security.repo rpm_i386_v2.1.repo rpm_i386_v2.1_security.repo"
    for var in $subsvn_dir
    do
        echo "****  $var *****"
        cd $target_svn_dir/$var/v2.1/
        eval $add_to_svn
        echo "**** $?"
:<<Comment
        svn add `svn st | grep ? | grep rpm | cut -c 9-`
        svn delete `svn st | grep ! | grep rpm | cut -c 9-`
        svn commit -m "submit `date`"
Comment
    done
}

commit_to_svn $1

  

shell脚本实现svn目录同步和提交

标签:tar   x86_64   grep   同步   done   shell脚本   shell   val   for   

原文地址:https://www.cnblogs.com/noxy/p/10566738.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!