Accidents Will Happen 23 chainsaw was just a rite of passage for its users.” “May it please the court, we will show that getting bilked of their life savings by Mr. Keating was just a rite of passage for those retirees.” Right. Changing rm’s Behavior Is Not an Option After being bitten by rm a few times, the impulse rises to alias the rm com- mand so that it does an “rm -i” or, better yet, to replace the rm command with a program that moves the files to be deleted to a special hidden direc- tory, such as ~/.deleted. These tricks lull innocent users into a false sense of security. Date: Mon, 16 Apr 90 18:46:33 199 From: Phil Agre agre@gargoyle.uchicago.edu To: UNIX-HATERS Subject: deletion On our system, “rm” doesn’t delete the file, rather it renames in some obscure way the file so that something called “undelete” (not “unrm”) can get it back. This has made me somewhat incautious about deleting files, since of course I can always undelete them. Well, no I can’t. The Delete File command in Emacs doesn’t work this way, nor does the D command in Dired. This, of course, is because the undeletion protocol is not part of the operating system’s model of files but simply part of a kludge someone put in a shell command that happens to be called “rm.” As a result, I have to keep two separate concepts in my head, “delet- ing” a file and “rm’ing” it, and remind myself of which of the two of them I am actually performing when my head says to my hands “delete it.” Some Unix experts follow Phil’s argument to its logical absurdity and maintain that it is better not to make commands like rm even a slight bit friendly. They argue, though not quite in the terms we use, that trying to make Unix friendlier, to give it basic amenities, will actually make it worse. Unfortunately, they are right.
24 Welcome, New User! Date: Thu, 11 Jan 90 17:17 CST From: merlyn@iwarp.intel.com (Randal L. Schwartz) Subject: Don’t overload commands! (was Re: rm *) Newsgroups: alt.folklore.computers We interrupt this newsgroup to bring you the following message… #ifdef SOAPBOX_MODE Please, please, please do not encourage people to overload standard commands with “safe” commands. (1) People usually put it into their .cshrc in the wrong place, so that scripts that want to “rm” a file mysteriously ask for confirmation, and/or fill up the disk thinking they had really removed the file. (2) There’s no way to protect from all things that can accidentally remove files, and if you protect one common one, users can and will get the assumption that “anything is undoable” (definitely not true!). (3) If a user asks a sysadm (my current hat that I’m wearing) to assist them at their terminal, commands don't operate normally, which is frustrating as h*ll when you've got this user to help and four other tasks in your “urgent: needs attention NOW” queue. If you want an “rm” that asks you for confirmation, do an: % alias del rm -i AND DON'T USE RM! Sheesh. How tough can that be, people!?! #endif We now return you to your regularly scheduled “I've been hacking so long we had only zeros, not ones and zeros” discussion… Just another system hacker. Recently, a request went out to comp.unix.questions asking sysadmins for their favorite administrator horror stories. Within 72 hours, 300 messages were posted. Most of them regarded losing files using methods described in this chapter. Funny thing is, these are experienced Unix users who should know better. Even stranger, even though millions of dollars of destruction
Previous Page Next Page