Shell Script Standards

These guidelines should be followed when writing shell scripts.

Musts

Executability

Error Handling

Syntax

Formatting

Shoulds

Portability

Whenever it's reasonable to do so (doesn't add significant burden for little or no gain), it is preferable to:

Remember that for the most part, OS X is BSD and not GNU/Linux. On OS X, sed, awk, and some other commands do not support all of the features and parameters of their GNU counterparts.

Error Handling

Syntax

Formatting

Documentation

Tips & Tricks