Live data from Hacker News

What typing ^D does on Unix (2009)

utcc.utoronto.ca

131–140 of 162 posts

Re: What typing ^D does on Unix (2009)

#131
post #24

Earlier quoted context omitted.

More generally, type ~ as an escape sequence. For example, type ~^Z to put a session in the background. Similarly, type ~~ to send an escape sequence in an inner session, etc...

... There's a program called SSH to get to another CPU. Tilde is the escape, it's doubled to send it through, And "quit" is tilde-. I think you know how the rest goes...

What does this reference?

Re: What typing ^D does on Unix (2009)

#132
post #24

Earlier quoted context omitted.

More generally, type ~ as an escape sequence. For example, type ~^Z to put a session in the background. Similarly, type ~~ to send an escape sequence in an inner session, etc...

... There's a program called SSH to get to another CPU. Tilde is the escape, it's doubled to send it through, And "quit" is tilde-. I think you know how the rest goes...

I don't - and in fact I finally got around to creating a HN account in order to ask you. Googling that just leads me back to this discussion. What's it from?

Re: What typing ^D does on Unix (2009)

#133

As a corollary, typing ^D twice on a non-empty line will also send EOF on the input, allowing you to provide a program with input not ending with \n from the command line. I knew about this behavior, but not why it worked, but this article's explanation clarifies this behavior as well. The first ^D terminates the read() call, passing the line so far, without terminating \n, to the program. The second causes read() to…

I asked about this on StackOverflow a few years ago, and got a great answer. http://stackoverflow.com/questions/15666923/sys-stdin-does-n...

...and i remember answering a similar question on SO.

http://stackoverflow.com/a/35537499/319204

Re: What typing ^D does on Unix (2009)

#134

Earlier quoted context omitted.

How did modems deal with pluses in data? Was there a way to escape the escape sequence, or was there just an ATSnnn or similar sequence to disable escapes?

There were a bunch of different mechanisms depending on vendor. Some required a specific time interval in between the + signs, so that typing very slowly, or instantly, wouldn't trigger the escape. Some vendors had bugs in which when +++ appeared as part of the incoming data it would also trigger the firmware escape. And of course programmable terminals had hilarious exploits where you'd get someone to run your progr…

> "let it sit in the rack"

So do they do scheduled collections of failed units? Or just let them sit there indefinitely?

Re: What typing ^D does on Unix (2009)

#135

Earlier quoted context omitted.

There were a bunch of different mechanisms depending on vendor. Some required a specific time interval in between the + signs, so that typing very slowly, or instantly, wouldn't trigger the escape. Some vendors had bugs in which when +++ appeared as part of the incoming data it would also trigger the firmware escape. And of course programmable terminals had hilarious exploits where you'd get someone to run your progr…

> "let it sit in the rack" So do they do scheduled collections of failed units? Or just let them sit there indefinitely?

The entire rack gets replaced with new equipment eventually. Probably get replaced every few years or so.

For most of the SMB clients I have, I don't build new servers any longer. I can buy rackmount servers pulled out of a data center that are a few years old at about 1/3 the price. I just put new disks in them and a new OS.

Re: What typing ^D does on Unix (2009)

#137
post #96
post #54

Earlier quoted context omitted.

Fun trick: If somebody is watching you type in your login password or SSH pubkey password, spaz wildly on the keyboard, frantically typing random characters, and then hit ^U and type in your real password. Then you give them a puzzled look once you successfully log in as if nothing out of the ordinary just happened and say something like "What, don't you have a sufficiently complex password?".

As long as you don't hit space you can do the same thing with ^W, as ^W will clear out the last 'word'. I use it all the time at password prompts, and more comfortable to hit than ^U.

It's easier if you switch Ctrl and Caps because they n it just looks like you're just using the shift key.

Re: What typing ^D does on Unix (2009)

#138
post #105

Neat. So when my terminal is spewing output because I ran "cat massivefile" instead of "cat massivefile | head", I can hit ctrl-D to stop it instead of repeatedly hitting ctrl-C and despairing.

No, thats what ctrl-s and ctrl-q are for. Here's the rest in one place: eof VEOF EOF character eol VEOL EOL character eol2 VEOL2 EOL2 character erase VERASE ERASE character erase2 VERASE2 ERASE2 character werase VWERASE WERASE character intr VINTR INTR character kill VKILL KILL character quit VQUIT QUIT character susp VSUSP SUSP character start VSTART START character stop VSTOP STOP character dsusp VDSUSP DSUSP chara…

Back in the day, using a slow modem or teletype, discard (flush output) was super important, but several years back when I hooked up an actual Wyse dumb terminal to a Linux box I was dismayed to discover that it's actually not implemented in Linux.

Re: What typing ^D does on Unix (2009)

#139
post #49

I wish articles like this would say what ^D means. I remember when I was new to Unix it took me a while to realize that I wasn't supposed to type a literal caret (^) followed by a D. For reference it means Ctrl+D, unless you you have a strange keyboard from Sun or something.

I just tried to search for it as if I didn't know and it was hard. Maybe wikipedia should describe that ^ is common representation among first lines, not in details section. Also macOS (former osx) uses this symbol everywhere: http://www.macinstruct.com/images/command.png

Yes, but it is so annoying and confusing that these symbols are not printed on the actual keyboard. Looking at the keyboard doesn't help much when I try to press a shortcut I just saw in the menu.

Re: What typing ^D does on Unix (2009)

#140
post #99
post #97

Directly after reading the title the question "what does ^D do" was fired at a Old Unix Beard friend of Mine who happens to be here for coffee. Instant reply Without any latency: "It originally was meant to terminate the Tape drive"

[citation needed] I suspect they're misremembering what the T in EOT stands for.

For the lazy: https://en.wikipedia.org/wiki/End-of-Transmission_character
Post reply on HN