@@ -182,10 +182,10 @@ taskwrapper() {
182182 -e \" libc++abi.*terminating\" \
183183 -e \" There was a crash.\" "
184184
185- grepcommand=" grep -H ${pattern} $logfile ${JOBUTILS_JOB_SUPERVISEDFILES} >> encountered_exceptions_list 2>/dev/null"
185+ grepcommand=" grep -a - H ${pattern} $logfile ${JOBUTILS_JOB_SUPERVISEDFILES} >> encountered_exceptions_list 2>/dev/null"
186186 eval ${grepcommand}
187187
188- grepcommand=" grep -h --count ${pattern} $logfile ${JOBUTILS_JOB_SUPERVISEDFILES} 2>/dev/null"
188+ grepcommand=" grep -a - h --count ${pattern} $logfile ${JOBUTILS_JOB_SUPERVISEDFILES} 2>/dev/null"
189189 # using eval here since otherwise the pattern is translated to a
190190 # a weirdly quoted stringlist
191191 RC=$( eval ${grepcommand} )
@@ -196,7 +196,7 @@ taskwrapper() {
196196 if [ " $RC " != " " -a " $RC " != " 0" ]; then
197197 echo " Detected critical problem in logfile $logfile "
198198 if [ " ${JOBUTILS_PRINT_ON_ERROR} " ]; then
199- grepcommand=" grep -H -A 2 -B 2 ${pattern} $logfile ${JOBUTILS_JOB_SUPERVISEDFILES} "
199+ grepcommand=" grep -a - H -A 2 -B 2 ${pattern} $logfile ${JOBUTILS_JOB_SUPERVISEDFILES} "
200200 eval ${grepcommand}
201201 fi
202202
@@ -375,7 +375,7 @@ taskwrapper() {
375375 # ?? should directly exit here?
376376 wait $PID || QUERY_RC_FROM_LOG=" ON"
377377 # query return code from log (seems to be safer as sometimes the wait issues "PID" not a child of this shell)
378- RC=$( grep " TASK-EXIT-CODE:" ${logfile} | awk ' //{print $2}' )
378+ RC=$( grep -a " TASK-EXIT-CODE:" ${logfile} | awk ' //{print $2}' )
379379 RC_ACUM=$(( RC_ACUM+ RC))
380380 if [ " ${RC} " -eq " 0" ]; then
381381 if [ ! " ${JOBUTILS_JOB_SKIPCREATEDONE} " ]; then
0 commit comments