Live data from Hacker News

Ooops.

github.com

11–20 of 247 posts

Re: Ooops.

#11
I don't remember the exact details, but a few years ago there was a Perl module that did something like:

   my $path = something_that_can_return_undef_on_failure;
   `rm -rf /$path`;
during the execution of its test suite. The author didn't catch it in testing because he never ran "make test" as root (who would?). But people on the Internet ran "make test" as root, with disastrous consequences.

Re: Ooops.

#17

I use the safe-rm ( http://freshmeat.net/projects/safe-rm ) package to help me avoid doing this kind of thing.

Do you not find that a lack of wide installation limits its usefulness?

You can use GNU remove, which lets you put arguments last for safety, on any Linux box:

Eg:

rm /whatever -rf

Ie, if you hit enter too early, you still haven't forced.

I've been using Linux for 14 years and have never accidentally rm'd recursively. I'm not sure when they added it, but I've been using it for a very long time.

Re: Ooops.

#18
While we're on the subject, has anyone successfully found/created a replacement for rm on OS X that moves files to the trash, but doesn't break the interface of rm for use in scripts?

Re: Ooops.

#19

just tried to explain this to a few of my windows using coworkers.

Just tell them it's the same as a Windows installer accidentally removing the entire Program Files directory.
Post reply on HN