From a7ca83d1e862184b5a84d31842e31b5dca4983d9 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Wed, 29 Jan 2020 21:27:35 +0100 Subject: [PATCH] mail_wrap_script.sh: fix command err code retrieval --- mail_wrap_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_wrap_script.sh b/mail_wrap_script.sh index c5a1356..2452287 100755 --- a/mail_wrap_script.sh +++ b/mail_wrap_script.sh @@ -10,7 +10,7 @@ touch /tmp/$FILE_ID.log chmod a-rwx,u+r /tmp/$FILE_ID.log $SCRIPT "$@" 2>&1 | tee /tmp/$FILE_ID.log -ERR=$? +ERR=${PIPESTATUS[0]} OUTPUT=$(cat /tmp/$FILE_ID.log) rm /tmp/$FILE_ID.log