Chapter 1: The machine

Pipe

Also called Pipeline, pipefail

The | character. It feeds one program's stdout into the next program's stdin, so small tools combine: grep ERROR app.log | sort | uniq -c finds lines, sorts them and counts repeats. By default, the whole line reports only the last program's exit code.

It is how an agent reads without drowning: tail keeps only the last lines, so a long test run costs it far less to read. But bun test | tail -20 reports how tail went, so failing tests look fine unless a setting called pipefail is on. An agent can fool itself this way, and so can you.

Say it to your agent

“Run this as set -o pipefail; bun test 2>&1 | tail -30. I want the last 30 lines and the real exit code of the tests, not of tail.”

The workshop

Name a word, or describe what you mean in everyday language.