Index: /issm/trunk-jpl/jenkins/jenkins.sh
===================================================================
--- /issm/trunk-jpl/jenkins/jenkins.sh	(revision 26816)
+++ /issm/trunk-jpl/jenkins/jenkins.sh	(revision 26817)
@@ -419,17 +419,4 @@
 	#filter out windows characters:
 	cat matlab_log.log | tr -cd '\11\12\40-\176' > matlab_log.log2 && mv matlab_log.log2 matlab_log.log
-
-	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log.log  | wc -l`
-
-	if [[ ${matlabExitedInError} -ne 0 ]]; then
-		echo "----------MATLAB exited in error!----------"
-		cat matlab_log.log 
-		echo "-----------End of matlab.log-----------"
-
-		# Clean up execution directory
-		rm -rf ${ISSM_DIR}/execution/*
-
-		exit 1
-	fi
 fi
 # }}}
@@ -469,18 +456,4 @@
 		cat python_log$i.log >> python_log.log
 	done
-
-	# Check that Python did not exit in error
-	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python_log.log | wc -l`
-
-	if [ $pythonExitedInError -ne 0 ]; then
-		echo "----------Python exited in error!----------"
-		cat python_log.log
-		echo "-----------End of python_log.log-----------"
-
-		# Clean up execution directory
-		rm -rf $ISSM_DIR/execution/*
-
-		exit 1
-	fi
 fi
 # }}}
@@ -513,4 +486,18 @@
 		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
 	done
+
+	# Check that MATLAB did not exit in error
+	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log.log | wc -l`
+
+	if [ $matlabExitedInError -ne 0 ]; then
+		echo "----------MATLAB exited in error!----------"
+		cat matlab_log.log
+		echo "-----------End of matlab_log.log-----------"
+
+		# Clean up execution directory
+		rm -rf $ISSM_DIR/execution/*
+
+		exit 1
+	fi
 fi
 
@@ -525,4 +512,18 @@
 		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
 	done
+
+	# Check that Python did not exit in error
+	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python_log.log | wc -l`
+
+	if [ $pythonExitedInError -ne 0 ]; then
+		echo "----------Python exited in error!----------"
+		cat python_log.log
+		echo "-----------End of python_log.log-----------"
+
+		# Clean up execution directory
+		rm -rf $ISSM_DIR/execution/*
+
+		exit 1
+	fi
 fi
 
@@ -538,4 +539,18 @@
 		juLog -test=Example-$i -name=Failure -error=FAILURE awk "/^starting: ${i}$/{flag=1;next}/^finished: ${i}$/{flag=0} flag{print}" matlab_log_examples.log
 	done
+
+	# Check that MATLAB did not exit in error
+	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log_examples.log | wc -l`
+
+	if [ $matlabExitedInError -ne 0 ]; then
+		echo "----------MATLAB exited in error!----------"
+		cat matlab_log_examples.log
+		echo "-----------End of matlab_log.log-----------"
+
+		# Clean up execution directory
+		rm -rf $ISSM_DIR/execution/*
+
+		exit 1
+	fi
 fi
 
