# Bash Scripting

> Bash scripting standards with safe quoting, parameter expansion, error handling, and command execution patterns. Use for any .sh file edits.

- Skill: `myfintechpl/bash-scripting` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add myfintechpl/bash-scripting`
- Raw SKILL.md: https://api.skillmd.com/api/skills/myfintechpl/bash-scripting/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: myFinTechPL (https://skillmd.com/u/myfintechpl)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/myfintechpl/bash-scripting

---


# Bash Scripting

## Baseline
- Use bash with strict mode unless documented.
- Use local variables in functions.

## Quoting & Expansion
- Quote variables by default.
- Use "$@" not $*.
- Use ${10}+ for positional parameters above 9.

## Command Execution
- Treat bash -lc wrappers as string-command APIs.
- Never join arguments with "$*".

## Security
- Validate inputs.
- Avoid eval.
- Minimize remote shell injection risk.

## Reuse
- Prefer lib/ helpers for logging, exec, fs, asserts.

## ShellCheck
- Prefer ShellCheck-clean code.
- Document SC suppressions when required.

