Time to revisit this thread.
Turns out vim has a nifty trick where you can do like the following:
Code:
:wq[stuff]
and it'll write out whatever you've got as "[stuff]" instead of whatever the original file was. Note: this only works for certain filenames, the choices of which can be incredibly absurd as you will soon see.
Well, I was working on a file marked read-only, and went to write it out, which to those who don't know, is done with the good old "do it anyhow" wildcard also known as an exclamation point (!) or "bang." Only I missed the bang and hit kablooey instead(Note: CWD was /root/):
Quote:
:wq~
Vim dutifully told me
Code:
"~" 235L, 7843C written
Uh-oh. Well, this was fun, and here I was straight out of the gym in the morning without so much as a cup of coffee to prop up my endorphin-spun brain cells.
Clickety-linkety to behold the horror that almost happened next:
http://www.taupehat.com/images/misc/pathexpansion.jpg
After I studied that one, I literally smacked my forehead, having come within a fraction of pulling the classic unix blunder. Oh well

And yes, I did get rid of the silly file.