bash

Standardize Bash scripting with set -euo pipefail and quoting conventions.

Updated Jun 9, 2017
One-click install
npx skills add https://github.com/dixonwille/.dotfiles --skill bash-dixonwille
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash
Source: https://github.com/dixonwille/.dotfiles/tree/main/claude/.claude/skills/bash
Command: npx skills add https://github.com/dixonwille/.dotfiles --skill bash-dixonwille

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bash scripting often lacks a shared set of safety and portability conventions, leading to brittle scripts and difficult maintenance.

Core Features & Use Cases

  • Enforces safe error handling with set -euo pipefail, strict variable usage, and careful quoting.
  • Promotes predictable script behavior through absolute path resolution and explicit directory navigation.
  • Aids auditing and collaboration by standardizing naming, comments, and subshell variable scope.

Quick Start

Apply these conventions when writing or reviewing Bash scripts to improve reliability and safety.

Frequently Asked Questions about bash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce safe error handling in Bash scripts?

Safe Bash scripting uses set -euo pipefail to enforce strict error handling, undefined variable detection, and pipe failure exposure. This prevents scripts from continuing silently after errors, reducing brittle automation and maintenance costs.

Why do my Bash scripts fail when navigating directories during deployment?

Bash scripts fail during directory navigation without absolute path resolution. Standardizing directory changes with explicit paths and predictable subshell behavior ensures scripts execute reliably across different deployment environments.

What is the best way to standardize Bash scripting conventions for a team?

Standardizing Bash conventions involves enforcing quoting discipline, strict variable scopes, and consistent naming. Applying these rules during code review improves collaboration, auditability, and overall script predictability.

Does strict variable quoting matter in shell scripting?

Strict variable quoting matters significantly in shell scripting. Enforcing quoting discipline prevents word splitting and globbing issues, ensuring variables expand predictably and reducing unexpected script behavior.

How do I prevent unexpected variable scope leaks in Bash subshells?

Prevent variable scope leaks by standardizing subshell behavior and explicit variable declarations. Careful scoping ensures variables remain predictable within automation scripts, avoiding side effects in parent shells.