Help With Constructing A Korn Shell Search Loop

Hello All,
I am a statistician and I am very new to the world of ksh programming. Daily, I analyze millions of rows of data and land information to DB2 tables. I have recently been asked to develop a ksh script to FTP an export file containing line item data from the production environment to the test environment. I have been able to construct the ksh code to initiate the ftp and to initiate the change of directories to the designated mount point (a directory) in my test environment. The issue that I am having is constructing a loop to do the following:
� To initiate a search that scans the mount point (a directory) in the test environment for files with a specified extension (such as exp.load).
� If the extension is found, I want the loop to wait a specified period and then scan for the file extension again.
� I want the loop to continue for five rotations of the specified time interval and if the file is still contained in the mount point to end the Ftp process.
� If the specified file extension is not found I want the ftp command (put) to begin for the designated file and once finished to terminate the ftp process.
Any help that you can give me will be apperciated. Thank you for your time.
jonesdk5:confused:

If that make sense...

# Begin_FTP_Process
for i in 1 2 3 4 5
do
    ls *exp.load && { sleep 30; continue; }
    # waits 30 seconds, can be 4m for 4 minutes --> man sleep
    # FTP put $FILE ....
    break
done
# End_FTP_Process

Frans,

Thank you for the quick response. I will try it immediately!
I will inform you of my results.

Jonesdk5