← 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 -- on the user's machine that's 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; flagged here when the version cut matters. ## Severity rubric Severity rubric: matches `rules/markdown-report.md` (failure/warning/info). ## 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 `[ ]`, glob vs literal, numeric vs string comparison, `(( ))`, `case` | | [reference/functions-