Google Shell Style Guide
by Google · Google (google.github.io/styleguide)
Google's production conventions for Bash: file layout, quoting, variable expansion, function naming, checking return values, avoiding eval, and recognising when a script has outgrown the shell. Answers the question the reference manual deliberately does not: of the many legal ways to write something, which one survives a code review. Includes the 100-line rule — the honest guidance that shell has a ceiling. Short enough to read once and reuse as a review checklist.
More resources on Bash & Shell Scripting
Advanced Bash-Scripting Guide
Free book-length guide to Bash scripting by Mendel Cooper, moving from basic scripts through variables, quoting, loops, functions, arrays, regular expressions, I/O redirection and subshells, with hundreds of annotated example scripts. Readers learn to write and debug nontrivial shell programs.
The Missing Semester of Your CS Education: Shell Tools and Scripting
Covers Bash variables, quoting, control flow, functions, exit codes, globbing and shebangs, then finding files and code with find, fd, grep and ripgrep, and reusing shell history. Includes an hour-long lecture video, full notes and exercises; learners can write and debug small automation scripts.
Bash Pitfalls
Sixty-five annotated examples of shell code that looks correct and is not, each with the failure mechanism explained and a safe rewrite. Working through it shows why parsing ls, unquoted expansions and set -e break production scripts. BashGuide builds the model, Pitfalls stress-tests it against the specific failure modes that separate a script that works on your laptop from one that works on a fleet.
Classic Shell Scripting
Robbins and Beebe on writing portable POSIX shell scripts, with substantial coverage of the surrounding toolset: grep, sed, awk, sort, find and xargs. Predates Bash 5 but remains the standard treatment of text-processing pipelines.
ShellCheck
Static analysis tool that flags quoting bugs, word-splitting errors, portability problems and misused constructs in shell scripts. Paste a script into the web version or run it locally; every warning links to a wiki page explaining the failure and the fix.
GNU Bash Reference Manual
The official manual for Bash 5.3, documenting shell syntax, expansions, redirections, builtins, variables, job control, line editing and history. Written by the maintainers, it is the authoritative statement of what each construct actually does.