- Reformat function definitions
POSIX states that compound commands, i.e., ones that use (..) or
{ .. } , are permissible as function definitions, however, many shell
syntax validators do not acknowledge the former format.
Switch to the latter format so more naive editors, like the vim syntax
highlighter, better parse the syntax of the file.
Moreover, replacing (..) with {..} replaces several subshells with
their non-subshell equivalents. Given that set -e is used liberally
and exit is not used in the calling code when set -e is not
enforced, there is no net loss by making this change.
- Clean trailing whitespace.
- Reindent some related comments to match the indentation of the previous line.
- Add shebangs to the tops of files to help syntax colorizers and file identifiers understand that the files are in shell syntax.