From ff2b9c152ab5023850ab59e754885a5683744960 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oriol=20Tint=C3=B3?= <oriol.tinto@lmu.de>
Date: Tue, 16 May 2023 15:45:44 +0200
Subject: [PATCH] Fix error in job status check.

---
 examples/01_real-from-ideal.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/01_real-from-ideal.sh b/examples/01_real-from-ideal.sh
index 0d67bf7..fc19695 100755
--- a/examples/01_real-from-ideal.sh
+++ b/examples/01_real-from-ideal.sh
@@ -156,7 +156,7 @@ if [ "$STAGE" -eq 0 ]; then
   autosubmit setstatus ${EXPID} -ft PREPARE_EXPERIMENT -t SUSPENDED -s -np
   autosubmit run ${EXPID}
   # Check if there are failed jobs
-  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] || exit 1
+  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] && exit 1
 fi
 
 if [ "$STAGE" -eq 1 ]; then
@@ -165,7 +165,7 @@ if [ "$STAGE" -eq 1 ]; then
   autosubmit setstatus ${EXPID} -ft EXTPAR_FROM_IDEALIZED FG_ANA_FROM_IDEALIZED -t SUSPENDED -s -np
   autosubmit run ${EXPID}
   # Check if there are failed jobs
-  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] || exit 1
+  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] && exit 1
 fi
 
 if [ "$STAGE" -eq 2 ]; then
@@ -174,7 +174,7 @@ if [ "$STAGE" -eq 2 ]; then
   autosubmit setstatus ${EXPID} -ft TRANSFER -t SUSPENDED -s -np
   autosubmit run ${EXPID}
   # Check if there are failed jobs
-  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] || exit 1
+  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] && exit 1
 fi
 
 if [ "$STAGE" -eq 3 ]; then
@@ -182,5 +182,5 @@ if [ "$STAGE" -eq 3 ]; then
   autosubmit setstatus ${EXPID} -fs SUSPENDED -t WAITING -s -np
   autosubmit run ${EXPID}
   # Check if there are failed jobs
-  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] || exit 1
+  [ -s autosubmit/${EXPID}/tmp/ASLOGS/jobs_failed_status.log ] && exit 1
 fi
-- 
GitLab