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
Consistently Inconsistent 25 was reported in those messages, most of those very same sysadmins came to Unix’s defense when it was attacked as not being “user-friendly.” Not user friendly? Unix isn’t even “sysadmin friendly”! For example: Date: Wed, 14 Sep 88 01:39 EDT From: Matthew P Wiener weemba@garnet.berkeley.edu To: RISKS-LIST@kl.sri.com4 Subject: Re: “Single keystroke” On Unix, even experienced users can do a lot of damage with “rm.” I had never bothered writing a safe rm script since I did not remove files by mistake. Then one day I had the bad luck of typing “!r” to repeat some command or other from the history list, and to my horror saw the screen echo “rm -r *” I had run in some other directory, hav- ing taken time to clean things up. Maybe the C shell could use a nohistclobber option? This remains the only time I have ever rm’ed or overwritten any files by mistake and it was a pure and simple gotcha! of the lowest kind. Coincidentally, just the other day I listened to a naive user’s horror at running “rm *” to remove the file “*” he had just incorrectly created from within mail. Luckily for him, a file low in alphabetic order did not have write permission, so the removal of everything stopped early. The author of this message suggests further hacking the shell (by adding a “nohistclobber option”) to make up for underlying failing of the operating system’s expansion of star-names. Unfortunately, this “fix” is about as effective as repairing a water-damaged wall with a new coat of paint. Consistently Inconsistent Predictable commands share option names, take arguments in roughly the same order, and, where possible, produce similar output. Consistency requires a concentrated effort on the part of some central body that promul- gates standards. Applications on the Macintosh are consistent because they follow a guidebook published by Apple. No such body has ever existed for 4Forwarded to UNIX-HATERS by Michael Travers.