Overview of the scripting and automation cheat sheets: shell, build tooling, Python and the checks that keep scripts correct. Start with Bash, keep Bash Recipes open while writing, and lint everything before it ships.
| SHEET | DESCRIPTION |
|---|---|
| Bash | Strict mode, variables, quoting, arrays, parameter expansion, tests, loops, functions, trap, getopts, here-docs, redirection |
| Bash Recipes | Argument parsing, logging, flock lockfiles, retry with backoff, safe temp files, idempotent checks, xargs -P |
| Zsh | Startup files, arrays, expansion flags, globbing qualifiers, zmv, options, completion, differences from Bash |
| Fish | Not-Bash translation table, set scopes, functions, abbreviations, string and math |
| Nushell | Structured pipelines, variables, custom commands, scripts, configuration |
| Shell Comparison | Bash, Zsh, Fish, Nushell and PowerShell syntax side by side, choosing and switching shells |
| ShellCheck and shfmt | Static analysis and formatting for shell, common SC codes, CI usage |
| Make | Makefile syntax, phony targets, variables, pattern rules, self-documenting help |
| Python and uv | uv projects, venvs, tools, inline script metadata, pyproject.toml |
| pip and pipx | pip installs, requirements, hashes, config, cache; pipx for isolated CLI tools |
| pre-commit | Run linters and secret scanning before every commit and in CI |
| SHEET | USE FOR |
|---|---|
| Grep | Searching text |
| SED Cheat-Sheet | Stream edits and substitution |
| AWK | Column and field processing |
| jq | JSON in pipelines |
| curl | HTTP requests and API calls |
| Linux | Everyday administration commands to script |
| SITUATION | USE |
|---|---|
| Glue between commands, under about 100 lines | Bash |
| Needs arrays of structured data, JSON, HTTP, retries, tests | Python (a single file with uv run and inline metadata) |
Repeatable project tasks (up, lint, deploy) |
make calling small scripts |
| Must run on minimal images (Alpine, BusyBox) | POSIX sh, lint with shellcheck -s sh |
- Start with
#!/usr/bin/env bashandset -Eeuo pipefail. - Quote every variable expansion.
- Clean up with
trap ... EXIT; usemktempfor temporary files. - Make scripts safe to run twice (idempotent).
- Print errors to stderr and exit non-zero on failure.
- Run ShellCheck and shfmt locally and via pre-commit.