Call a infinite loop

Hi All,

I need to run an infinite loop.
requirement below:

function1 --> creates a file file1
function2 ---> need to call if the file creates
i am running these both function via a script --> script.sh

i need to run the function1 first and if the file file1 creates then need to run the function2 and if file1 not created wait for 1min and again start the process i.e call function1 and if this time creates the file call function2. Wait till function 2 returns something. Irrespective of return value of function2 ( may be failed or succeed ) need to start the process again (i.e. function1 and file check and call function2) .

Please help me if its possible in unix scripting. Also ask me if need any more details.

Thanks,
Satya

Under what circumstances could function1 not create the file, file1?

Use following :

while true
do
function1_creating_file
A=$?
if [ $A -eq 0 ]
then
function2
else
sleep 60
fi
done

:b:

Hi scottn,
I am looking into a table if there is any update value then will create the file with that value. There may be more than one value. function1 will pick the last value and delete it. So if a value is picked by function1 will write to the file. And if file created then need to call function2 which processed the file. wait till it fails/success, again function1 will kick off look on the other updated value. And if no value will sleep and again look after one minute.

Thanks,
Satya