~/ learn/ comp-325/ cards/ Why `2>&1` has to come last
1 of 11

The ordering pair, and the two-file alternative

The ordering pair, and the two-file alternative

Answer

make > build.log 2>&1 make 2>&1 > build.log make > build.out 2> build.err

Line 1 puts everything in build.log. Line 2 puts only the output there and leaves errors on your screen. Line 3 sidesteps the question entirely by naming two files, so no descriptor is duplicated.

S&K 3e ch9 §9.6–9.9, §9.13

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/318c561c-5caf-4e3f-be99-dbe7dd3e6c12/flashcard utf-8 LF