

Bash Style Guide - rom10
https://google-styleguide.googlecode.com/svn/trunk/shell.xml

======
dozzie
* Bash is the only shell scripting language permitted for executables.

Yeah, how about no? Bash is the shell known for being incompatible in how
bashisms work (I'm looking at you, [[ ]]) between _minor_ versions. It's safer
to assume you won't use Bash at all.

* Use sudo to provide elevated access if you need it.

Don't. sudo often doesn't provide enough separation, is fragile and _very_
sensitive to configuration changes and shell is very difficult language to
serialize and deserialize data safely. Architecture your tooling so it doesn't
require privilege elevation.

* [[ ... ]] is preferred over [, test and /usr/bin/[.

It is not. It's a bashism, which tends to be incompatible in very subtle ways
between minor Bash versions. Happy bug hunting in such cases.

* Variables modified in a while loop do not propagate to the parent because the loop's commands run in a subshell.

Only valid for Bash. Under other shells you _cannot_ assume the while loop
will be in a separate process.

* The keyword function is optional, but must be used consistently throughout a project.

It should not be used at all. It's excessive and unnecessarily binds the code
to Bash (other shells often don't recognize this keyword).

...and so on. Somebody apparently hasn't used shell much.

