我的svn propset
命令在从提示符调用时有效,但在 bash 脚本的 while 循环内调用时不能正常工作。
我的命令如下所示,
svn propset -r945 --revprop svn:log '[Release ] [story]' blahReport.sh
我的脚本在下面,
[[ ! -n $1 ]] && echo "Please enter the release number" && exit 1
[[ ! -e $AC_SYSTEM/releases/filesforrelease.$1.txt ]] && rm $AC_SYSTEM/releases/filesforrelease.$1.txt
cat $AC_SYSTEM/releases/release_$1.txt >> $AC_SYSTEM/releases/filesforrelease.$1.txt
sed "s/^/#/g" $AC_SYSTEM/releases/filesforrelease.$1.txt >> /tmp/filesforrelease.$1.txt
mv /tmp/filesforrelease.$1.txt $AC_SYSTEM/releases/filesforrelease.$1.txt
svnlink="http://sublime-ssi/blah/blah/trunk"
while read -r story
do
if [[ ! -e $story.file ]];
then
while read -r storyline
do
revNum=`echo $storyline | cut -d"|" -f1`
fileName=`echo $storyline | cut -d"|" -f2`
echo "$revNum ~ac/$fileName" >> $AC_SYSTEM/releases/filesforrelease.$1.txt
svn propset -r"$revNum" --revprop svn:log "[$1] [$story]" "$svnlink"/"$fileName"
done<$AC_SYSTEM/stories/$story.file
else
echo "story file for $story does not exist..please check the story directory"
exit 1
fi
done</export/home/acdba/ac/releases/release_$1.txt
我在脚本上做了一个 set -x 但对我来说看起来不错。
不知道缺少什么..这对其他人来说可能是显而易见的,有什么建议吗?