Hacker News new | ask | show | jobs
by ConfucianNardin 3185 days ago
This will work fine until the day when you mistype >> into >, and all your notes are gone.
3 comments

Not if you have `set -C` in your ~/.bashrc, which prevents you from overriding files with >.
That seems like a real risk, true.

But at least at $THE_OFFICE, I'm lucky that there's a trivial-to-recover ~/.snapshot/hourly.?/notes file. YMMV.

A `cat -i` switch could be good.
A flag for cat won't help you - it's your shell that does the redirection. You're looking for `set -o noclobber` (same as `set -C`).
Ah, let's go with `> -i` then! :)