ch03 · foundation · 80-110 min
streams, pipes, and redirection
Understand stdin, stdout, stderr, pipes, redirection, quoting, and shell expansion.
You can build small pipelines and explain where data is flowing.
shows: A command reads stdin (fd0) and writes two independent outputs — stdout (fd1) and stderr (fd2) — each redirectable on its own, so `>` captures data while `2>` captures diagnostics.
does not prove: It shows the wiring of the three streams, not that any given command actually sends errors to stderr — a few tools misroute diagnostics to stdout, so you still confirm by inspecting both targets.
Lessons in this chapter
-
ch03/l01
stdin, stdout, stderr
2>Know which stream carries data and which carries diagnostics. -
ch03/l02
Pipelines and filters
sort | uniq -cCompose small tools into an evidence-producing report. -
ch03/l03
Quoting and shell expansion
printf '%s\n' ./*.logPrevent the shell from changing your command before the program sees it.
search pipeline report
Build a null-safe pipeline that finds copied log files, searches for one term, counts matches, and writes a report.
DeliverableA report plus the tested pipeline stages.
Success criteria
- Each stage has a named purpose.
- Filenames with spaces survive.
- Errors are not hidden inside data output.
Searching
After you can explain pipeline input and output without relying on trial and error.