loop until true

Hi

I need help with a script to loop unitl the statement is true
done some thing like this

until
if [ -d /xx/xx ]
then 
   cp filename filename.anto
fi
done

Regards,

I added a sleep because a continuous loop will eat your system for lunch.

while [ ! -d /xx/xx ]
do
    sleep 1
done
# we get here only when the /xx/xx directory comes into existence
cp filename filename.anton

thanks. that helps

---------- Post updated at 12:25 PM ---------- Previous update was at 12:24 PM ----------

so the cp filename filename.anto comes after the done

Alternative:

until [ -d /xx/xx ] 
do 
  sleep 1 
done 
cp filename filename.anto