From c400d67159fdc034a0d0afbf51dc516d01f321b9 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Tue, 9 May 2023 13:27:43 +0000 Subject: [PATCH] cat pgmerr to logfile --- ush/job_preamble.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ush/job_preamble.sh b/ush/job_preamble.sh index 13983c5016..adb3f0b503 100644 --- a/ush/job_preamble.sh +++ b/ush/job_preamble.sh @@ -72,6 +72,7 @@ if [ "${RUN_ENVIR}" = "nco" ]; then export pgmerr="${DATA}/errfile" export REDIRECT_OUT_ERR=">>${pgmout} 2>${pgmerr}" export pgmout_lines=1 + export pgmerr_lines=1 function PREP_STEP() { export pgm="$(basename ${0})" @@ -94,6 +95,11 @@ if [ "${RUN_ENVIR}" = "nco" ]; then pgmout_line=$( wc -l $pgmout ) pgmout_lines=$((pgmout_lines + 1)) fi + if [ -f $pgmerr ]; then + tail -n +${pgmerr_lines} $pgmerr + pgmerr_line=$( wc -l $pgmerr ) + pgmerr_lines=$((pgmerr_lines + 1)) + fi } else export pgmout=