I'll second everything that Mike said, but I did catch a pretty likely culprit.
The continue statement jumps back to the while condition, so the statement incrementing MIN_LOOP_COUNT is never executed.
Code:
if [[ $ERROR_CDE = "" ]]
then
break
else
continue
fi
((MIN_LOOP_COUNT=MIN_LOOP_COUNT+1))
According to
man ksh:
Code:
- continue [ n ]
Resume the next iteration of the enclosing for, while, until, or
select loop. If n is specified, then resume at the n-th enclos-
ing loop.
The fix is to remove the else clause entirely:
Code:
if [[ $ERROR_CDE = "" ]]
then
break
fi
((MIN_LOOP_COUNT=MIN_LOOP_COUNT+1))