Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!dciem!nrcaer!cognos!brianc
From: brianc@cognos.uucp (Brian Campbell)
Newsgroups: comp.cog-eng,comp.unix.xenix,comp.unix.wizards
Subject: Re: Request for human interface design anecdotes (and a cure?)
Message-ID: <1915@cognos.UUCP>
Date: Wed, 2-Dec-87 13:39:44 EST
Article-I.D.: cognos.1915
Posted: Wed Dec  2 13:39:44 1987
Date-Received: Sun, 6-Dec-87 02:11:25 EST
References: <3103@psuvax1.psu.edu> <1987Nov21.014754.19660@sq.uucp> <392@xyzzy.UUCP> <1987Nov27.011955.10801@sq.uucp>
Reply-To: brianc@cognos.UUCP (Brian Campbell)
Organization: Cognos Incorporated, Ottawa, Canada
Lines: 31
Xref: dciem comp.cog-eng:325 comp.unix.xenix:1041 comp.unix.wizards:5057

In article <1987Nov27.011955.10801@sq.uucp> msb@sq.UUCP (Mark Brader) writes:
> In short, the proper UNIX flavored method for protecting important files
> from "rm" is to turn off the write permission bit.

Marking selected files as read-only is often useful for protecting files
in the singular sense.  However, it is also possible to protect an
entire directory from accidental erasure with:

   touch \!
   chmod -w \!

Now, when the careless (?) user enters "rm * .o" or any variation
thereof (excluding the addition of -f), the first file rm will encounter
will be !  (unless someone has filenames starting with spaces or other
unprintables).  rm will ask if the user really wants to delete this
file.  At this point, an INTR will stop rm from deleting any files at
all; answering n will simply tell rm not to delete that single file.

> As I said in my original posting, I do consider it a misfeature that
> if stdin is NOT a terminal then rm proceeds regardless of the file's
> permissions.  I think the -f flag should be required in that mode also.
> (I also think that having said that should have been sufficient
> prevention from having UNIX basics explained to me on the net.)

I do not think this is a "misfeature".  With shell scripts and system() calls
I have a chance after I have typed the command to verify that it is indeed
what I wanted.  When interactive, its too late after I've pressed return.
-- 
Brian Campbell        uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc
Cognos Incorporated   mail: POB 9707, 3755 Riverside Drive, Ottawa, K1G 3Z4
(613) 738-1440        fido: (613) 731-2945 300/1200, sysop@1:163/8