4 ms·
Banged my head against the wall once after trying to figure out why Ctrl+D generates some character in bash but I can't send that character in a pipe to simulat
by badrabbit 7y ago
Banged my head against the wall once after trying to figure out why Ctrl+D generates some character in bash but I can't send that character in a pipe to simulate termination.
- kylek 7y agoFun fact, ctrl-v in bash sets "verbatim insert" mode for the next character, so you can type a ^D "character" by doing "ctrl-v ctrl-d".
- pwdisswordfish2 7y agoIt’s not bash, it’s the tty device driver. Applications can switch between the ‘cooked’ mode (which recognises it as EOF) and ‘raw’ mode (which passes it through) by performing some ioctl I don’t really want to look up right now.
- nixpulvis 7y agoI think I may still be banging my head on this one. It's just an ioctl difference between my pipe and my terminal's session, right?
- enriquto 7y ago> Banged my head against the wall once after trying to figure out why Ctrl+D generates some character in bash but I can't send that character in a pipe to simulate termination. Yes, you can. You just end your stream by closing the pipe.