Hacker News new | ask | show | jobs
by CRConrad 1407 days ago
Yeah, but you had to type "EOF" to get out of the "cat >>" sub-process, didn't you? There's probably no way to automate / hide that away... (?) Sure, it's pretty good the way it is already, but it bugs me that you have to type that bit that isn't what you want to note. (Who, me? What OCD?)
1 comments

The essence of this tiny "interactive command line utility" is to capture user key strokes and redirect to a sub-process. So there gotta be a way to interrupt and exit the sub-process. "EOF" is just a convention. You can also get out of the sub-process with "Ctrl-D" like in Python shell.

Interactive editors like vi/emacs also need to flush the buffer and save the content to the file, but you have to type something, such as ":w" and "C-x C-s" (or use GUI).

If you want full automation without human input, I/O redirection is the way.