The following code gives
[: -ge: unary operator expected
when
i=0 if [ $i -ge 2 ] then #some code fi
Judging from the error message the value of i was the empty string when you executed it, not 0.