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

Code:
sqlplus user/passwd@move << EOF
select * from kk;
exit sql.sqlcode;
EOF
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 :-?