您的位置:首页 > 运维架构 > Shell

shell 脚本:svn 查找用户,并导出修改文件

2014-05-09 16:18 537 查看
#!/bin/bash
STR_FRUIT=`svn log /home/chen/www/JUANPI_V3/ -v -l100 | grep cunzhang`
no_df=''
IFS_old=$IFS
IFS='行'

for version_number in $STR_FRUIT
do
#获取版本号
no_df=${version_number%| cunzhang |*}
no_df=${no_df#*r}

if [  $no_df ]; then

#获取日志列表
exec_command="svn log -r $no_df -v"
re_svn_list=$(eval $exec_command)

#获取bug号
bug_n=$re_svn_list
bug_n=${bug_n#*bug #}
bug_n=${bug_n:0:4}

myPath="/home/chen/www/bug_$bug_n";
if [ ! -x "$myPath" ]; then
mkdir "$myPath"
fi

re_svn_list=${re_svn_list#*改变的路径:}
re_svn_list=${re_svn_list%fix bug*}
IFS=$IFS_old
for filelist in $re_svn_list
do
if [  $filelist ]; then
#echo $file_list;
str10=${filelist:0:10}
if [ "$str10" = "/branches/" ]; then
filelist=${filelist:24:100}

file_dir=$myPath/$filelist;
file_dir=${file_dir%/*}
if [ ! -x "$file_dir" ]; then
mkdir -p "$file_dir"
fi

cp /home/chen/www/$filelist $myPath/$filelist;
fi

fi

done

fi
done

IFS=$IFS_old
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: