Chapter 1: The machine

Redirection

Also called 2>&1, /dev/null

Sending a stream somewhere other than the screen. > writes stdout to a file, replacing what was there, and >> adds to the end. 2> does the same for stderr. 2>&1 sends stderr wherever stdout is going. /dev/null throws away whatever reaches it.

Agent commands are full of this. 2>&1 is there so errors get captured too. > /dev/null 2>&1 means nobody will see anything, including failures. Read the end of a long command first, because that is where output gets hidden.

Say it to your agent

“Don't send that to /dev/null. Run it with > build.log 2>&1, then show me the exit code and the last 30 lines with tail -30 build.log.”

The workshop

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