• Use 'if cmd; then ..' to check exit code, or 'if [ "$(cmd)" = .. ]' to check output.
  • Problematic code:
  • Correct code:
  • Rationale:
  • Exceptions:
  • Related resources: