The parts of Bash that bite in production: quoting, parameter expansion, exit codes and redirection order. Learn why "$@" is not "$*", what set -euo pipefail buys you, and why 2>&1 >file does not do what it looks like — remembered with spaced repetition.
Shell scripts fail quietly. An unset variable expands to nothing and a command runs against the wrong path; a pipeline reports success because only its last stage mattered; a loop on the right-hand side of a pipe updates variables in a subshell that then disappears. None of these produce an error — they produce a wrong result that looks like a right one.
This track is built around those failure modes. It covers the quoting and expansion rules that decide whether an argument survives as one word, the difference between ${var:-default} and ${var:=default}, why [[ ]] protects unquoted variables from word-splitting where [ ] does not, and what set -euo pipefail and trap actually change about how a script dies.
The remaining modules cover redirection and process substitution — including the left-to-right ordering that makes 2>&1 >file behave differently from >file 2>&1 — and the text tooling scripts lean on daily: grep, sed, awk, cut and uniq. Every card is grounded in the GNU Bash reference manual.
Each module is a set of flashcards — 50 in total. Answer, review, and watch your knowledge grow from seed to full bloom.
Parameter expansion, defaults, string operators, arrays, and single vs double quoting
10 cardstest and [[ ]], numeric vs string comparison, pattern and regex matching, case, for, while and until
10 cardsExit status, set -euo pipefail, trap, local scope, return values and positional parameters
10 cardsStdout and stderr, truncate vs append, 2>&1 ordering, here-strings, process substitution and pipe subshells
10 cardsEveryday grep, sed, awk, cut, sort and uniq patterns for scripting pipelines
10 cardsA taste of the real flashcards. Pick an answer, then reveal the explanation.
Inside double quotes, how do "$@" and "$*" differ?
Why is [[ ... ]] generally preferred over [ ... ] in Bash scripts?
Why do robust scripts commonly begin with set -euo pipefail?
Why does command 2>&1 >file still leave error output on the terminal?
Each card is one practical concept with multiple options. Pick what you think is right.
See the correct option plus a clear explanation, and a link to deeper docs when one is available.
A spaced-repetition engine (SM-2 or FSRS) resurfaces each card just before you would forget it.
"$@" forwards arguments intact, "$*" flattens them into one. That single distinction prevents a whole category of bugs with filenames containing spaces.
set -e, set -u and pipefail each catch a different silent failure, and trap gives you cleanup that runs even when the script exits early.
Redirections apply left to right against the target a stream points at right now. Learn that and the classic 2>&1 confusion resolves permanently.
${file%.txt}, ${str//foo/bar} and ${#name} do in the shell what most scripts fork sed or basename for — shorter, faster, and harder to get wrong.
Bash. Several of the constructs covered — [[ ]], arrays, <(process substitution), ${str//foo/bar} — are Bash extensions and are not available in a plain POSIX shell. Where that matters, the cards say so.
Basic familiarity helps — you should be comfortable at a prompt. The track is about the shell language and its semantics rather than a tour of commands; the Linux tracks cover the command-line surface itself.
Indirectly. Shell scripting is part of LPIC-1 exam 102, so this track reinforces it, but it is written around writing robust scripts rather than around the exam objectives. The LPIC-1 tracks map to those directly.
Yes, completely free. No registration or credit card is required, and all your progress is stored locally in your browser.
Plant your first seed today. Ten minutes a day turns shell folklore into rules you can explain.