Earlier quoted context omitted.
Darnit, I had to dial in again. Kidding of course, but once upon a time many 56k6 modem contained a bug that, upon receiving this in plain text, would cause an actual modem hangup. You could kill hundreds of IRC connections with that one.
It wasn't exactly an unintentional bug - rather one company owned a patent on the technique of enforcing a guard time before and after the attention string to go into command mode (the Hayes '302 patent). They licensed it for $1/modem, but some manufacturers felt that they couldn't afford that.
What typing ^D does on Unix (2009)
121–130 of 162 posts
Re: What typing ^D does on Unix (2009)
#122Re: What typing ^D does on Unix (2009)
#123Earlier quoted context omitted.
Something I use extensively in terminals is ^L and ^M. ^L clear the screen and ^M for a line return.
I'm not proud of this, but I sometimes bounce between ^N (next-line in emacs) and ^I (tab character, bound to various thing in different emacs modes) to re-indent a region. I usually only do this for <10 lines. More than that and I go look up the function that does it 'right'.
Re: What typing ^D does on Unix (2009)
#124Earlier quoted context omitted.
It's not about neutrality, it's about ease of understanding. For me at least, when speaking about something that can be entered into a keyboard ^D is less obvious than Ctrl+D–I need to press the key labeled "control" to issue the proper command, the key labeled "^" will not suffice.
Even then though, why is it obvious that you don't need to press the key labelled + as well?
Re: What typing ^D does on Unix (2009)
#125Earlier quoted context omitted.
I am amazed by the fact that I never accidentally trigger this feature.
You'd probably trigger it more often if ~/ didn't conveniently map to ~/ - it's quite cleverly designed in a way. Indeed, most of the two-character combinations you're likely to type starting with ~ map to themselves.
Re: What typing ^D does on Unix (2009)
#126Earlier quoted context omitted.
To be really pedantic (sorry! I'm not complaining about your comment), your keyboard does not have any key labelled 'control', it is always (AFAIK) abbreviated as 'ctrl'. Which is really weird to me, as it's hardly a big word needing abbreviating, and keyboards often have other long words written on the keys ('delete', 'page down', and so on). On top of that, the shortened 'ctrl' is really a terrible abbreviation. It…
You're incorrect, especially for the typical reader here. A good chunk (maybe not over 50%, but its gotta be close) of the regular readers on this site use Macs. Most Mac keyboards, including the ones on the Macbook Pro, spell it out. Same for most non IBM/IBM-PC compatible keyboards.
Re: What typing ^D does on Unix (2009)
#127http://www.linusakesson.net/programming/tty/
...and the extensive previous HN discussion on it:
https://news.ycombinator.com/item?id=10631513
https://news.ycombinator.com/item?id=10064657
https://news.ycombinator.com/item?id=8094186
https://news.ycombinator.com/item?id=4544318
Re: What typing ^D does on Unix (2009)
#128Earlier quoted context omitted.
Actually the remote sshd does not need to be responsive, because " ~." is interpreted by the local ssh client. Very convenient if the TCP connection is stuck. You can also type " ~?" for a list of other commands supported by the local ssh client. Among other things, " ~C" opens a command line interpreter on the client side of the ssh client, allowing you to add and remove TCP port forwarding without restarting the co…
Ahg, I wish it let you scp files into your working directory too. That's be convenient.
You log in, type "rz", and then use escape sequence to upload a file. (similar for downloading)
The patch was rejected. Shame. It's very useful when hopping 6 steps to upload a file.[1]
I can't find the patch now, but I'm considering rewriting it as a an `expect` script. My `expect` scripts tend to have trouble with SIGWINCH propagation though, so not optimal. Also you have to remember to wrap with the `expect` script at (and preferably only at) the one "jump" you want to send from/to with the final destination.
[1] No, nothing illegal. Just that some networks mandate SSH jumpgates, and sometimes multi-level.
Re: What typing ^D does on Unix (2009)
#129Earlier quoted context omitted.
^\ is actually sigquit, which is a bit different from sigkill, since programs can catch QUIT and perform some cleanup.
Also ^| (as in, "control pipe") which is a synonym for ^\. At least for me, | is faster to hit than \ And since we're on this topic: if I write a for loop in bash that runs a slow command 1000 times (ImageMagick comes to mind), and I realise something has gone wrong, is there an easy way of breaking the outer loop?
^Z
fg
^C
the ^Z kills the loop, the fg and ^C cleans up the currently running one.
Re: What typing ^D does on Unix (2009)
#130Neat. 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.
Also, a side note, I would rather just run "head massivefile" or even better "less massivefile" (because, most probably I'd want to see past what head shows by default). Running cat and then piping it to another program is inefficient, 2 forks + pipe.