Skip to content

Course

Shell Scripting That Doesn't Bite

Write Bash you can hand to a teammate: strict mode, quoting, arrays, xargs, traps, temp files, cron vs systemd timers, and the failure modes that delete production.

9 lessons

Course Q&A

Write Shell a Teammate Can Run

Strict mode, quoting, word splitting, and arrays — the foundations that make scripts predictable.

  1. 01set -euo pipefail: the First Five LinesWhat errexit, nounset, and pipefail actually do, where set -e quietly does nothing, and the local bug.15mOpen
  2. 02Quoting and Word SplittingWhy unquoted $var bites, "$@" vs "$*", [ vs [[, and the injection angle.14mOpen
  3. 03Arrays, Loops, and Reading Lines SafelyReal lists instead of space-separated strings, while read without losing data, and the pipeline subshell trap.16mMembers

Pipelines, Files, and Cleanup

xargs done right, temp files without leaks, and traps that actually fire when things go wrong.

  1. 01xargs, find -exec, and Pipelines That Scale-print0 | xargs -0 as the only correct contract, -P parallelism, and pipelines built to be run at scale.18mMembers
  2. 02mktemp, Atomic Writes, and Cleanup TrapsThe only correct temp file, the write-then-rename pattern for atomic publication, and EXIT traps.16mMembers
  3. 03Signals, Trap Ordering, and Leaving the Box CleanEXIT vs ERR vs TERM, single vs double quotes in traps, killing children, and what SIGKILL can't see.15mMembers

Scheduling and Production Safety

cron vs systemd timers, locks and idempotence, and the patterns that don't delete production.

  1. 01cron vs systemd TimersMissed runs, minimal environments, OnCalendar and Persistent=true, and why a oneshot service can't overlap itself.20mPremium
  2. 02flock, timeout, and Idempotent ScriptsMutual exclusion that survives SIGKILL, bounding stuck commands, and scripts safe to run twice.16mPremium
  3. 03The Traps That Delete ProductionEmpty-variable rm -rf, rsync --delete direction, symlink-swap deploys, and the pre-flight checklist.18mPremium