2 ms·
So if I'm reading this correctly, you need to quote your text, and it can't be multi-line... why not this: alias notes='cat >> ~/notes' Just hit ctrl+c (s
by lucb1e 9y ago
So if I'm reading this correctly, you need to quote your text, and it can't be multi-line... why not this:
alias notes='cat >> ~/notes'
Just hit ctrl+c (stops cat) or ctrl+d (signals EOF) when you're done writing. No quoting, special characters that might act funny, line or size limits, etc.
- dylanpyle 9y agoI've been using a variation on this for a bit: (echo && date && cat) >> ~/notes.txt Adds a newline and datestamp above each note group
- jasonm23 9y agoDepending on the shell in use C-c (will|won't) write to the redirected output file. C-d remains constant, but it's irritating that there's no way to consistently abort. To deal with this our edit target needs to be a temporary file which we subsequently bless, append to the notes file and then trash. Keeping notes open in an editor buffer that I can jump to easily, and manually: >> notes.md From the command line gains me all the utility I need while using a modern machine and zsh. Of course, if I time travel, the GP trick is useful on old ultrix machines.