Does the file /tmp/unex exist? If it does not exist, is there some reason to think that it might be created while your script is running? If it does exist, is there some reason to think that it might be removed while your script is running?
What output are you getting?
What output do you want to get?
With no indication of what you are trying to do and no indication of the state of the conditions being tested by your script, it is hard to guess at what you might think right or wrong?
#!/bin/ksh
c=0
while [[ ! -f /tmp/unex && $c -lt 10 ]]; do
echo /tmp/unex NOT found, iter : $c;
((c = $c + 1));
sleep 2;
done
(note that ksh is in /bin instead of /usr/bin on my system) and the file /tmp/unex does not exist; I get the output:
/tmp/unex NOT found, iter : 0
/tmp/unex NOT found, iter : 1
/tmp/unex NOT found, iter : 2
/tmp/unex NOT found, iter : 3
/tmp/unex NOT found, iter : 4
/tmp/unex NOT found, iter : 5
/tmp/unex NOT found, iter : 6
/tmp/unex NOT found, iter : 7
/tmp/unex NOT found, iter : 8
/tmp/unex NOT found, iter : 9