← ClaudeAtlas

bash-patternslisted

Bash and shell script patterns covering safety flags, quoting, conditionals, traps, functions, ShellCheck discipline, and review-worthy anti-patterns. Use whenever the project contains `.sh`, `.bash`, `.zsh` files (or files with bash/sh shebangs), scripts in `bin/`, dotfiles like `.zshrc`/`.bashrc`/`.zprofile`, Makefile recipes, OR the user asks about bash, shell, scripts, or any shell-pipeline work, even if "bash" is not mentioned by name.
ku5ic/dotfiles · ★ 0 · Data & Documents · score 72
Install: claude install-skill ku5ic/dotfiles
# Bash patterns Default assumption: bash 5.x targeting macOS (via Homebrew bash) and Linux. Scripts use `#!/usr/bin/env bash` so the resolved binary is whatever is first on PATH, which on the user's machine is the Homebrew 5.x build, not the stock macOS `/bin/bash` 3.2. Anything that requires bash 4.0+ (case modification, `mapfile`, `${parameter@op}`) is unsafe under stock macOS bash and is flagged here when the version cut matters. ## Severity rubric - `failure`: a concrete defect or violation that should not ship. - `warning`: a smell or pattern that compounds with other findings. - `info`: a hardening opportunity or note, not a defect. ## Reference files | File | Covers | | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | [reference/safety-flags.md](reference/safety-flags.md) | Script preamble, `set -euo pipefail` edge cases, `inherit_errexit`, `nullglob`, verification before shipping | | [reference/quoting.md](reference/quoting.md) | Quoting rules, nested quoting, heredoc indentation, `printf` over `echo`, zsh-vs-bash differences | | [reference/conditionals.md](reference/conditionals.md) | `[[ ]]` over `[ ]`,