Does anyone know how to trap the sqlcode of an sql statement

sqlplus user/passwd@move << EOF
select * from kk;
exit sql.sqlcode;
echo $?
This works partially, the code returned should be ORA-942 but it returns 174 because in UNIX the exit status is from 0 - 255, anyone know a way to overcome this :-?