/Error/ { errors += 1 print $0 } /Warning/ { warnings += 1 if ( ! ($0 ~ /Non-standard character/) ) print $0 } END { if (errors >= 1) exit 2 }