• Check exit code directly with e.g. if mycmd;, not indirectly with $?.
  • Problematic code:
  • Correct code:
  • Rationale:
  • Exceptions: