Accidents Will Happen 21 DOS and Windows give you something more like a sewage line with a trap than a wastebasket. It simply deletes the file, but if you want to stick your hand in to get it back, at least there are utilities you can buy to do the job. They work—some of the time. These four problems operate synergistically, causing needless but predict- able and daily file deletion. Better techniques were understood and in wide- spread use before Unix came along. They’re being lost now with the acceptance of Unix as the world’s “standard” operating system. Welcome to the future. “rm” Is Forever The principles above combine into real-life horror stories. A series of exchanges on the Usenet news group alt.folklore.computers illustrates our case: Date: Wed, 10 Jan 90 From: djones@megatest.uucp (Dave Jones) Subject: rm * Newsgroups: alt.folklore.computers2 Anybody else ever intend to type: % rm *.o And type this by accident: % rm *o Now you’ve got one new empty file called “o”, but plenty of room for it! Actually, you might not even get a file named “o” since the shell documen- tation doesn’t specify if the output file “o” gets created before or after the wildcard expansion takes place. The shell may be a programming lan- guage, but it isn’t a very precise one. 2Forwarded to UNIX-HATERS by Chris Garrigues.
22 Welcome, New User! Date: Wed, 10 Jan 90 15:51 CST From: ram@attcan.uucp Subject: Re: rm * Newsgroups: alt.folklore.computers I too have had a similar disaster using rm. Once I was removing a file system from my disk which was something like /usr/foo/bin. I was in / usr/foo and had removed several parts of the system by: % rm -r ./etc % rm -r ./adm …and so on. But when it came time to do ./bin, I missed the period. System didn’t like that too much. Unix wasn’t designed to live after the mortal blow of losing its /bin direc- tory. An intelligent operating system would have given the user a chance to recover (or at least confirm whether he really wanted to render the operat- ing system inoperable). Unix aficionados accept occasional file deletion as normal. For example, consider following excerpt from the comp.unix.questions FAQ:3 6) How do I “undelete” a file? Someday, you are going to accidentally type something like: % rm * .foo and find you just deleted “*” instead of “*.foo”. Consider it a rite of passage. Of course, any decent systems administrator should be doing regular backups. Check with your sysadmin to see if a recent backup copy of your file is available. “A rite of passage”? In no other industry could a manufacturer take such a cavalier attitude toward a faulty product. “But your honor, the exploding gas tank was just a rite of passage.” “Ladies and gentlemen of the jury, we will prove that the damage caused by the failure of the safety catch on our 3comp.unix.questions is an international bulletin-board where users new to the Unix Gulag ask questions of others who have been there so long that they don’t know of any other world. The FAQ is a list of Frequently Asked Questions gar- nered from the reports of the multitudes shooting themselves in the feet.
Previous Page Next Page