Hacker News new | past | comments | ask | show | jobs | submit login

This will work fine until the day when you mistype >> into >, and all your notes are gone.



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! :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: