Add whole-string quoting rule to bash style guide

This commit is contained in:
lachtan
2026-03-15 16:34:14 +01:00
parent 0d5eb492aa
commit b9fa65b141

View File

@@ -48,6 +48,7 @@ function do_thing() {
- `(( ))` for arithmetic comparisons
- `$(command)` for substitution, never backticks
- Double quotes around expansions: `"$var"`, `"${array[@]}"`
- Quote the whole string, not just the variable: `"$HOME/.local/bin"` not `"$HOME"/.local/bin`
- Single quotes for literals that must not expand
- `printf` over `echo` when output contains escapes or format strings