problem creating bash loop through svn list output
Bram Kuijper
a.l.w.kuijper at rug.nl
Tue Nov 25 16:31:03 UTC 2008
Hi all,
I hope this question is not too specific for a ubuntu mailing list, but
it is about simple bash shell scripting. I cannot get bash to properly
loop through the output of a svn list command, like this:
svnlist=`svn list file:///myrepository/directory`
for i in "$svnlist"; do
echo "$i";
echo "nextline";
done;
However, this does not work at all, the variable $svnlist is not
splitted into separate items, but just passed as a whole list to $i, so
the output looks like:
file1
file2
file2
nextline
instead of the desired output:
file1
nextline
file2
nextline
file3
nextline
Why does bash looping appear to seamlessly work with commands like ls(),
but does it choke on svn list?
thanks in advance,
Bram kuijper
More information about the ubuntu-users
mailing list