• General Code Style
  • Indentation
  • Line Length and Long Strings
  • Bad:
  • Good:
  • Good:
  • Pipelines
  • Bad:
  • Good:
  • Good: All fits on one line
  • Use environment variables
  • Bad:
  • Good:
  • If / For / While
  • Good:
  • Variables
  • Naming Conventions
  • Bad:
  • Good:
  • Bad:
  • Good:
  • Bad:
  • Good:
  • Good:
  • Use local variables
  • Bad:
  • Good:
  • Bad: with global variables
  • Good: with local variables
  • Constants and Environment Variable Names
  • Constant:
  • Constant and environment:
  • Read-only Variables
  • Functions
  • Naming Conventions
  • Bad:
  • Good:
  • Good:
  • Use and check return values
  • Bad:
  • Good:
  • Check return values
  • Bad:
  • Good:
  • Good:
  • Good: use "$?" to get the last return value
  • Features and Bugs
  • Command Substitution
  • Bad:
  • Good:
  • Eval
  • References