4 ms·
> the process has to be programmed to stop if read returns no bytes. A process could carry on regardless, or not read stdin at all. In Bash, if you type half a
by jwilk 4y ago
> the process has to be programmed to stop if read returns no bytes. A process could carry on regardless, or not read stdin at all. In Bash, if you type half a command and press ^D repeatedly, nothing happens.
It's not a good example, because bash disables the canonical mode. When you type ^D this happens:
read(0, "\4", 1) = 1
(And then bash ignores the read EOT character.)
- rhooke 4y agoAuthor here. You're correct. I've added a footnote to that part now. I think it still illustrates the point so I've left the main text alone.