ksh script: 'exit' being treated as 'break 2'

hi,

in a korn shell script, has anyone ever seen an 'exit' being treated as a 'break 2'? I have a script which has 3 nested loops. Within the inner most loop, i'm trying to exit the script on a fault condition. instead of exiting, it's acting as a 'break 2' and then continuing on with the script. I would cut-n-paste the code, but it's quite lengthly. Instead, I'll boil it down to:
cat <file1> |while read LINE
do
grep $LINE <file2> |while read LINE2
do
for i in 1 2
do
if [ "`echo ${LINE2} |cut -f1`" = "YES" ] ; then
echo "YES found"
exit
echo "HERE"
fi
done
echo "HERE1"
done
echo "HERE2"
done
echo "HERE3"

Upon execution of this script, i get the messages:
YES found
HERE2
HERE3

Any help will be GREATLY appreaciated!

I'm trying to recreate that problem, but my script exits out immediately, as expected.. you may either want to paste the actual code that is affected (unless it's hundreds of lines or something) or redo your logic in such a way that you don't use the EXIT command .. there's always a way.

I find it hard to believe that ksh would work like that. On the other hand, I can easily believe it of sh. How sure are you that ksh is running that code?

I ran the code too - exits out like it's suppose to - unless you remove #!/bin/ksh from the begining of the script ( and my default shell is csh).

Then it doesn't exit out anymore. Check the top of your script.

I've got a few UNIX servers (HP-UX) here. After doing some "this server vs. that server" testing, I narrowed it down to being a patching problem. Applying the HP patch PHCO-27418, which is a cumulative KSH patch, solved the problem.

Thanks everyone for your replies. I appreciate the feedback.