Skip to main content

New answers tagged

1 vote

Why does "seq 1000000 | tee /dev/stdout" produce more single-digit numbers than expected?

As Stéphane Chazelas explained, tee is the wrong tool for the job of duplicating line-based input into a single output stream. It interleaves data at block boundaries that can be within a line. If ...
Peter Cordes's user avatar
  • 6,690
23 votes

Why does "seq 1000000 | tee /dev/stdout" produce more single-digit numbers than expected?

Having both of tee's outputs going to the same pipe creates tearing within lines because they don't start/end at the boundaries of read/write blocks. tee, reads its input and writes its output by ...
Stéphane Chazelas's user avatar

Top 50 recent answers are included