Hi,
I did a lot of search for this but I could not find it, so I am posting it here....Please help.
I have a situation where I need to do polling or sleep for a while...here is what I have..
#! /usr/bin/sh
job1 runs > result1.txt
RESULT1_CNT=`wc -l result1.txt | awk '{ print $1 }'`
if[ RESULT1_CNT -gt 0 ]
then
while [ RESULT1_CNT -gt 0 ]
do
JOb2 runs
RESULT1_CNT=RESULT1_CNT-1
done
else
#This is the part I am struggling for....
#here it should sleep for specified time and run job1 again...
#if the RESULT1_CNT is not greater than 0 three consecutive times
#then it should exit
any help is appreciated...
Thanks,
Girinath.