Shell configuration and install scripts for macOS and Linux.
When asked to check or scan a .sh or rc file, look for:
- PATH or env var appends that duplicate on re-source
- File appends (>>) without guards for existing content
- Symlink creation that nests inside existing directory symlinks (use
ln -sfn)
- Commands used without checking if installed (
command -v) - Variables referenced that may be unset (
$DOTFILES,$PKG_INSTALLER) - Files sourced without existence checks
- GNU vs BSD flag differences (e.g.
--max-depthvs-dfordu,grepvsggrep) - Hardcoded paths that differ across systems (
/opt/homebrewvs/usr/local)
- Unquoted variables that may contain spaces
- Broken escape sequences in echo/printf output (especially paths with spaces)
- Heredocs or multiline strings with unintended variable expansion
- Sourcing files from user-writable locations without validation
- Exporting secrets or credentials in plain text
- Using
evalwith untrusted input