well it gave me the same error. I will post my script, not because I want you to solve it for me but because I already trying this since last week and as a new guy where I need a lot of help
__________________________________________
#!/bin/sh
user=`whoami`
pname="svn `whoami`"
var=0
LOGFILE=`mktemp -t svn_checkout.XXXXXX`
ICONPATH="`dirname $0`/svn.xpm"
list=`ssh $user@192.168.1.3 "ls /esp-server/svn"`
URL=`zenity --entry --title="Subversion: Checkout" --text="$list
Enter repository folder according to the the aboves:" --entry-text="" --width=400 --window-icon="$ICONPATH" 2>&1`
#So until where is everything ok and my script work as I want. The problem was when #I wanted to add a progress bar to my script
if [ $? -eq 0 ]
then
svn checkout svn+ssh://$user@192.168.1.3/esp-server/svn/$URL &> $LOGFILE & pid1=$!
zenity --progress --pulsate --auto-kill & pid2=$!
while [ $var -lt 1 ]
do
ps aux | awk '{ print $11 " " $1 }' | grep svn > svn.txt
#until where is also ok
infile=`cat svn.txt`
echo $infile
until [[ "`cat svn.txt`" -eq "$pname" ]]
do
#then when it enters where I'm not sure if it works. Like, I know it goes inside the until #because the echo in the next lines are "echoed", but the until never stops and thats #very confusing because my condition is until "`cat svn.txt`" -eq "$pname" and after the svn command is done, the svn.txt is empty and so
#[["`cat svn.txt`" -eq "$pname" ]] is true and so should go out from the until
echo $infile
echo $pname
ps aux | awk '{ print $11 " " $1 }' | grep svn > svn.txt ;
done
$var=2 #this is for exit the while
kill $pid2 # and this to kill the progress bar
done
rm -f svn.txt
rm -f $LOGFILE
fi
and by the way, my verbose says error line 44 which is the last if. why
First, please edit your post and put [ code][/code ] tags around your source and reformat it properly.
Second, if you want the loop to run until svn.txt is empty again, why do you compare it with the contents of the $pname variable? If you want to find the contents of $pname in the file, use
while [[ grep -q $pname svn.txt ]]
which will do a "quite" grep, meaning only $? (the exit code) will be set.