Skip to main content

Bash

Recommendation
Updated
Moved
HOLD
2022-04-25

What is it

Bash is a Unix shell and command language.

When to use it

Use Bash for simple scripting use cases, such as build scripts to complement Makefiles.

How to use it

Style guide

Follow Google's Shell Style Guide.

Formatting

Format with shfmt using the default settings.

Linting

Lint with shellcheck using the default settings.

Additional conventions

Use /usr/bin/env

Prefer /usr/bin/env bash over /bin/bash as the shell. This works more consistently on e.g. NixOS.

How to learn it

See the Awesome Bash collection of resources for online books and interactive tutorials.