4. Google Shell Style Guide
The Google Shell Style Guide provides an existing well-thought-out set of detailed guidelines for shell scripting (and there are very few others to be found) that we have chosen to adopt as a foundation for our purposes. It is recommended to follow this guide as a baseline. For conciseness, the details are not reproduced here but the guide should be read in conjunction with this document.
The ChromiumOS
extensions
to the general Google guidance also offer some useful additions which
should be considered (in particular around shell arithmetic, defaulting
variables, printf
vs echo
and argument parsing with
getopts
).