I amrunning below script in KSH shell. I want to run the loop for 6 times to call Java program and in betwen if there is no exception found , then it should return =0. if in all the 6 iteration, we found any exception then it should return 3.
integer max=7;i=1
while [[ $i -lt $max ]]
do
Java call statement;
error_cnt=`$processing_file | grep -i excption | wc -l `
if (( $error_cnt == 0 ))
then
return_code=0;
break
else
Continue with java call
fi
(( i = i + 1 ))
done
If in all the 6 iterations still we finds exceptions then it should return 3.