File existence

Hey all,

I have total new with shell scripting so I don't know if what I need to do even possible, here it is...for a duration of time \(say...1 hour\) I need to check for the existence of a particular file, if it exists then I will invoke a java program or I will continue to check until a\) the file is found and break out of the loop to invoke program b\) time is up and no file is found then write error out to screen. Any sample would be greatly appreciated! Thanks in advance!

Pang

inter=0
interval=10

while [ inter -le 0 ]
do
    if [ -f ${FILE} ]
    then
        # INVOKE JAVA PROGRAM
        break
    fi
    sleep ${interval}
    (( inter += interval ))
file

I mean .....