svn库中添加、删除、提交文件的脚本
#!/bin/bash
COUNT=`svn status | grep '^?' |wc -l`
until [ $COUNT -lt "1" ]
do
CURRENT=`svn status | grep '^?' |awk {'print $2'} | head -$COUNT | tail -1`
echo "Do you want to add $CURRENT? (y/n): "
read ANS
if [ $ANS = "y" ]
then
svn add $CURRENT
echo "$CURRENT added to repository"
COUNT=`expr $COUNT – 1 `
elif [ $ANS = "n" ]
then
COUNT=`expr $COUNT – 1 `
fi
done
COUNT=`svn status | grep '^!' |wc -l`
until [ $COUNT -lt "1" ]
do
CURRENT=`svn status | grep '^!' |awk {'print $2'} | head -$COUNT | tail -1`
echo "Do you want to delete $CURRENT? (y/n): "
read ANS
if [ $ANS = "y" ]
then
svn delete $CURRENT
echo "$CURRENT added to repository"
COUNT=`expr $COUNT – 1 `
elif [ $ANS = "n" ]
then
COUNT=`expr $COUNT – 1 `
fi
done
echo "Enter a commit message: "
read MSG
svn commit -m "$MSG"