fixing rm * (was: Worm/Passwords)

jim gustafson ncgus at ndsuvax.UUCP
Sun Nov 20 11:52:43 AEST 1988


>In article <672 at quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>|Now, how _do_ you fix "rm *"?  Suppose you restrict rm to delete exactly
>|one file.  Watch:
>|      foreach F (* .o)
>|          rm $F
>|      end
>|OOPS!  Major bug in foreach!  Better fix that.
>|      [ other examples ]
>|
>|Moral: you can't change _one_ thing.

Maybe I missed something, but doesn't everybody have 'rm' re-defined as
an alias or $HOME/bin/rm?  Something like:

        for fnam in $*
        do
                mv -f $fnam $HOME/.trash
        done

In Korn, I use alias rrm=/bin/rm in my .kshrc so I can do the dirty work.
(the trick is to always use 'rm' ;-).
--
Jim Gustafson                   UUCP:     uunet!ndsuvax!ncgus
North Dakota State University   Bitnet:   ncgus at ndsuvax
Fargo, North Dakota 58105       Internet: ncgus at plains.nodak.edu



More information about the Comp.unix.wizards mailing list