Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!apple!julius.cs.uiuc.edu!wuarchive!uunet!ccicpg!felix!asylvain From: asylvain@felix.UUCP (Alvin E. Sylvain) Newsgroups: comp.unix.misc Subject: Re: Protection from "rm *" Message-ID: <151935@felix.UUCP> Date: 3 Oct 90 20:15:02 GMT References: <853@agcsun.UUCP> Sender: daemon@felix.UUCP Reply-To: asylvain@felix.UUCP (Alvin E. Sylvain) Distribution: usa Organization: FileNet Corp., Costa Mesa, CA Lines: 29 In article <853@agcsun.UUCP> jackm@agcsun.UUCP () writes: >I happened on an interesting way to protect against those accidental "rm *"'s >that take years off your life. [...] >This most likely isn't new, but I've never seen it. Anyway, just create >a file called "#" and turn off its write permission. Then if you type >"rm *", rm will ask if you want to override protection on "#" - BEFORE [...] > alias mkdir '/bin/mkdir \!^; touch \!^/#; chmod 0 \!^/#' [...] >So - anyone seen this before? See any drawbacks? [...] No, I haven't seen it before (cute!) ... one very minor drawback is that any files beginning with an even lower ascii value, such as space, ", !, or any control character, will be removed before you get to your # file. These files were probably created in error by a program, but may still be valuable. If this proves to be a problem (unlikely), you could solve it by using control-A instead of #. I don't see how a file could possibly begin with a NUL on a non-corrupted file system, so that one's out. Call it '?rm-check' or such, (?==^A) in case your ls command won't display control characters. (Ultrix displays them as ?) -- =======================Standard Disclaimers Apply======================= "We're sorry, but the reality you have dialed is no | Alvin longer in service. Please check the value of pi, | "the Chipmunk" or pray to your local diety for assistance." | Sylvain