Unix Job not failing as I would expect even though I have "Exit 1" in my script

Discussion created by JohnO'Mullane on Dec 19, 2017
Latest reply on Jan 2, 2018 by JohnO'Mullane
 I have a Unix shell script which has completed successfully but I expected it to fail.

I have an Exit 1 in my code 

echo "Checking DNFS....."
   count=`sqlplus -s '/ as sysdba'<<EOF
   set pagesize 0 feedback off verify off heading off echo off
   select count(*)  from v\$DNFS_stats where nfs_read >0 or nfs_write >0;

   if [[ "${count}" = '0' ]]; then
      echo "DB NOT running on DNFS"
      exit 1;
      echo "DB running on DNFS"
   #jdkv=`cat /tmp/$1_jdkver.log`
   jdkcnt=`cat /tmp/$1_jdkver.log|wc -l`
   jdkver=`expr $jdkcnt`
   if [ $jdkver -eq 1 ]; then
      echo "Java working query passed"
      echo "Java working query failed, Please check JAVA"
      exit 1;

When I run the Job, it's getting to this place in the code and exiting, but not failing.


I have done a little test myself with a simple unix Job I created with only this code


When I called from Automic, it behaved as I expected, job failed.


Has anyone seen this behavior before?