Use bash as interpreter, define variable ERRORS before using