Until loop

Hi

I just want to know if this until loop is write because my script is not working and I don't know where is my error and maybe it's in this until cicle

until [ ! `cat svn.txt` -eq $pname ]
do

...
done

So basicly I want to know if I can execute that command (cat svn.txt) and if the syntax is write

Thanks in advance

Did you try a trace with set -x? If so, was there anything unusual about it?
By the way, wouldn't it be more readable to write the loop as

while [[ "`cat svn.txt`" -eq "$pname" ]]
do
...
done

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

Please help
thanks in advance

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.

worst. now it kill me the bar before it finishs
just tell me one thing if you know

I have a second script that looks more simple

#!/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`

if ($? == 0) then
  svn checkout svn+ssh://$user@192.168.1.3/esp-server/svn/$URL &> $LOGFILE
  zenity --progress --pulsate --auto-kill & pid=$!
  echo "`ps aux | awk '{ print $11 " " $1 }' | grep svn`"
  echo "before while"
  while [ "`ps aux | awk '{ print $11 " " $1 }' | grep svn`" -eq "svn ruben"]
  do    
    echo "`ps aux | awk '{ print $11 " " $1 }' | grep svn`"
    echo "I'm inside the while"
  done
  kill $pid
fi

echo "end"

but when I execute it gives me this

Checkout2: 26: 0: not found
end

# the end is from the echo and the line 26 is the fi
Why man? like I think that my only error