Craigy90
August 11th, 2008, 05:07 PM
Hello,
Recently, I have been trying to write scripts to take care of tasks that I perform frequently. One of these tasks is updating all of the subversion repository checkouts that I watch. Here is an example of what I do:
echo BLENDER
cd ~/Blender/bf-blender/
svn up
which works in most cases.
However, I have run into a problem that I need to work around. In some repositories, I get the following error many times before the update works:
svn: Malformed network data
I looked around a bit, but did not find a solution to this besides updating repeatedly. So, what I thought I could/should do was to continually update until I no longer get the error message by watching for that string. Here is what it looks like now:
var=`svn up`
echo $var
while [ $var=="svn: Malformed network data" ]; do
var=`svn up`
echo $var
done
This seems to have the desired effect, but the command line output is ugly, to say the least:
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
U lib/exceptionhandler/exceptionhandler.c U lib/framework/wzglobal.h Updated to revision 5796.
./subversion.sh: line 58: [: too many arguments
What I want it to look like, (it would also be OK if the error lines were included without the newline after each one):
U lib/exceptionhandler/exceptionhandler.c
U lib/framework/wzglobal.h
Updated to revision 5796.
I want to fix this, but I also want to learn more about BASH and the CLI in the process. Also, if anyone knows about that subversion error, that would be helpful too. I would still want to know about handling text output from programs run from scripts like this.
Thanks in advance
Recently, I have been trying to write scripts to take care of tasks that I perform frequently. One of these tasks is updating all of the subversion repository checkouts that I watch. Here is an example of what I do:
echo BLENDER
cd ~/Blender/bf-blender/
svn up
which works in most cases.
However, I have run into a problem that I need to work around. In some repositories, I get the following error many times before the update works:
svn: Malformed network data
I looked around a bit, but did not find a solution to this besides updating repeatedly. So, what I thought I could/should do was to continually update until I no longer get the error message by watching for that string. Here is what it looks like now:
var=`svn up`
echo $var
while [ $var=="svn: Malformed network data" ]; do
var=`svn up`
echo $var
done
This seems to have the desired effect, but the command line output is ugly, to say the least:
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
svn: Malformed network data
U lib/exceptionhandler/exceptionhandler.c U lib/framework/wzglobal.h Updated to revision 5796.
./subversion.sh: line 58: [: too many arguments
What I want it to look like, (it would also be OK if the error lines were included without the newline after each one):
U lib/exceptionhandler/exceptionhandler.c
U lib/framework/wzglobal.h
Updated to revision 5796.
I want to fix this, but I also want to learn more about BASH and the CLI in the process. Also, if anyone knows about that subversion error, that would be helpful too. I would still want to know about handling text output from programs run from scripts like this.
Thanks in advance