# output "NOK" if standard error has any output; "OK" otherwise:errlog=$(mktemp)somecommand 1>> "$stdlog" 2> "$errlog"if [[ -s "$errlog" ]]; then # File exists and has a size greater than zero echo "NOK"else echo "OK"fi# Done parsing standard error; tack it to the regular logcat "$errlog">> "$stdlog"rm -f "$errlog"
↧
Answer by DopeGhoti for Is there a simple test for anything printed on stderr in shell/Bash?
↧