Now I havnt a different problem, I can use the following to run a script:

#/usr/bin/sh
sqlplus girs/gpassword < @test.sql
exit sql.sqlcode;
EOF
LOG=$?
echo log is $LOG
if [ $LOG != 0 ]
then
echo error
else
echo success
fi

Which works for a 1 command script but if the script contains 2 commands and the first command produces an error but the second command works ok the return value is ok.

eg:

Connected to:
Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production

SQL> select sysdate from dua
*
ERROR at line 1:
ORA-00942: table or view does not exist



SYSDATE
---------
12-APR-02

SQL> Disconnected from Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
log is 0
success


What I really need is a way of getting an error status for the whole script ie, if just one command fails the return status is non zero. Has anyone got any ideas?