I want to set a flag in a shell script (bash) so that if anything returns non-zero, a flag is set (i.e. set a variable like
So far, I've thought of calling the script with
scriptname.sh 2>Error.log and then doing something like:
if $(wc -l error.log) != 0; then errors="True"
There has got to be a much better way. Please enlighten me.