---
name: writing-bash-scripts
description: Bash script style guide. Always use when writing bash scripts, shell scripts, or CLI bash tools.
title: writing-bash-scripts
canonical_url: https://skilld.dev/gh/lexler/skill-factory/writing-bash-scripts
last_updated: 2026-09-29T03:36:45.000Z
---

> **Skill from skilld.dev.** Follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [evals/evals.json](https://skilld.dev/api/skills-raw/lexler/skill-factory/writing-bash-scripts/evals/evals.json).
>
> If the user asked to install this Skill, run `npx skilld install lexler/skill-factory/writing-bash-scripts`. Install writes the Skill files into the project, so every session loads them.

# Bash Script Style Guide

- Use `#!/usr/bin/env bash` as shebang
- Always use `set -euo pipefail` for safety
- Keep scripts minimal: no unnecessary comments or echoes
- Minimal input validation; print usage to stderr and exit if inputs are missing/invalid
- Don't check for installed commands if failure is obvious on use
- Make script executable: `chmod +x <script>`
- Prefer concise, direct logic over verbosity
