Maintainable Bash Scripting
summary
Concrete, actionable patterns for real scripts: use boolean simplifications with && and ||, replace repeated echo with here documents, prefer local variables and declare -r for globals, avoid positional arguments in favor of named parameters parsed with shift (helper parses offered), return data on stdout and parse JSON with jq, check status codes and use set -e/-x for debugging, make each step idempotent, put scripts on PATH, and follow practice exercises in the repository.
AI-written summary · about
chapters (8)
- 0:00Maintainable Bash Scripting
- 9:27Simplifications
- 15:10Variable Scope
- 18:21Order of Operations
- 22:50Returning Values
- 25:27Writing Effective Functions
- 35:56General Advice
- 38:27Questions?
related talks
56mDevOps: How to train your Bash
30mBash, the Developer's Swiss Army Knife
59mShell Ninja: Mastering the Art of Shell Scripting #slideless
47mTempting Fate: Patterns & practices for shareable scripts and functions
29mTake Back Your Bash by Becoming a CLI Ninja!
01h 02mBash is magic # No it's not
41mWork Smarter, Not Harder; Make Yourself Indispensable!
23mDon't write shell scripts, generate them!
