Bash for ops, done safely
For anyone comfortable at a Linux prompt who has never written a script. You learn the Bash language on Ubuntu Server 26.04 (Bash 5.3): variables, quoting, redirection, exit status, conditionals, loops, functions, arrays and command-line options. Then the part that keeps scripts from causing outages: what set -euo pipefail really does and does not catch, traps and signals, temp files, locks and timeouts, and ShellCheck, shfmt and Bats. Every script and output in the course was run on the lab machine, and the course ends with a backup job you could leave running.
01Your first scriptShebang, permissions, PATH, and why sh script.sh is not bash.25 min02Variables, quotes and command outputAssign, expand, quote, capture output and pass values to child processes.15 min03Input, output and redirectionprintf over echo, results vs errors in scripts, here-documents and read -r.20 min04Exit status and testsWhat $? tells you, exit codes 1/2/126/127/128+n, and [[ ]] vs [ ].30 min05Decisions: if, case and guard clausesBranch on exit status, match patterns with case, and fail closed.25 min
01Loops and reading input safelyfor over lists and globs, while read loops that keep every line, find -print0.25 min02Quoting, word splitting and globbingThe expansion order behind most script bugs, and the habits that prevent them.25 min03Functions, local and loggingFunctions with arguments, return vs exit, local scope and a stderr logger.30 min04Arrays and parameter expansionArgument arrays, associative arrays and ${var:?} guards on destructive paths.25 min05Command-line optionsgetopts, long options, --help, -- and a dry-run that changes nothing.25 min
01Strict mode, honestlyWhat set -e, set -u and pipefail catch, and the cases where they stay silent.40 min02Traps, signals and cleanupEXIT traps, INT and TERM handlers that exit honestly, and what no trap can catch.25 min03Temp files, locks and timeoutsmktemp, write-then-rename, flock, and timeout for commands that hang.30 min04Check your script: ShellCheck, shfmt and BatsLint, format and test a script before it runs anywhere that matters.25 min
Progress is saved in this browser only — no account required.
Quick reference
Final exam
Test yourself on everything
42 questions drawn from all 4 sections — every answer explained as you pick.