I have some inherited UNIX shell scripts that invoke sqlplus via a script called "qs" and then attempt to test their success or failure and behave accordingly but I'm having trouble finding researching "$?" online. Here is such an example:
Is the script testing a return code of some sort? If so, won't the only time it returns a bad value be if the invoked stored proc returns a non-zero value?
Code:
echo '--------------------------------------------------------------'
echo ' STEP01 -- PRODUCE THE UNRECONCILED ECOMMERCE REPORT '
echo '--------------------------------------------------------------'
echo
$HOME/bin/qs "exec RCPI.ecommerce_reconciliation_rpt"
#Check if last command is successful.
if [ $? -ne 0 ]
then
echo "An error occurred while running the Unreconciled report. Exiting..."
exit 11
fi