Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    these things are only true of canonical mode terminals. And even in that case they can be changed. Commented Jan 6, 2015 at 16:52
  • @mikeserv That's true. Here, I wanted to explain just what the OP was seeing. I considered also describing raw/-icanon terminal mode, other special characters, how they can be customized, how they differ by OS, etc. but didn't want to make the answer overly long. Commented Jan 6, 2015 at 17:23
  • Does the above imply that if input weren't going through cat, that a program which read data from the keyboard and didn't stop the first time read yielded a zero could keep on going, and the number of control-D's required would be determined by the number of consecutive zeroes the program required to decide it was done? Commented May 8, 2015 at 21:32
  • @supercat A program can keep on reading if it wants. In the ex editor, if you type a control-D as the first character of a line, the editor shows you a few lines of the program rather than exiting. (In ex and vi, Control-D is a mnemonic for "down"). And with many shells, if you type Control-D but have jobs running in the background, the shell will inform you of this rather than exiting, but if you type Control-D again, the shell decides that you really want to exit anyway and will do so. Commented May 8, 2015 at 21:47
  • @MarkPlotnick: Is there any way by which these zero-byte hiccups can be sent via pipe? Commented May 8, 2015 at 21:51