Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.unix.wizards Subject: taming "rm *" (was Re: Worm/Passwords) Summary: perfect solution Message-ID: <4819@bsu-cs.UUCP> Date: 18 Nov 88 16:12:39 GMT References: <22401@cornell.UUCP> <4627@rayssd.ray.com> <8563@rpp386.Dallas.TX.US> <125@embossed.UUCP> <672@quintus.UUCP> <466@yarra.oz.au> <8922@smoke.BRL.MIL> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 21 A universal fix for the "rm *" problem (if you can call it a problem) is to make the "rm" command a built-in, so it asks "Are you sure?" if the user attempts "rm *". Experienced users could alias "rm" to "rm -n", which never prompts with the "Are you sure?" message. Note that making "rm" a built-in does not mean that the code for it must be linked with the shell. The shell only needs to recognize "rm" and handle wildcard expansion in a special way, and then invoke /bin/rm to do the actual unlinking. This naturally means that a user could create a new alias for /bin/rm, or invoke /bin/rm by full pathname, to get the effect of the original program. This is actually a feature rather than a bug. Better still, let's avoid changing what established commands do. All shell authors, please include a special keyword "del" that prompts with the "Are you sure?" question if it sees "*" as a parameter, and then exec /bin/rm. Tell novice programmers to use "del". -- Rahul Dhesi UUCP: !{iuvax,pur-ee}!bsu-cs!dhesi