Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
How does a tool like grep know when the end of file is reached, when reading from stdin (like in
foo | grep)?
The EOF byte could belong to the original file, so it can't rely on that. Does it rely on the fact that the pipe is closed or something else?
21.3k2020 gold badges4747 silver badges7171 bronze badges
asked Dec 25, 2021 at 19:15
1322 bronze badges
Browse other questions tagged