Path: utzoo!utgpu!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: Creating a nondestructive 'rm' Message-ID: <1625@solo8.cs.vu.nl> Date: 5 Nov 88 00:45:35 GMT References: <4460006@hpindda.HP.COM> Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatica, Amsterdam Lines: 19 In article <4460006@hpindda.HP.COM> burdick@hpindda.HP.COM (Matt Burdick) writes: \Does anyone have a nice alias or shell script so that when I 'rm' a file it \will actually move it to, for instance, a tmp subdirectory in my home \directory? \ \Right now, I have an alias that does this, but the problem is that may \alias doesn't handle all of rm's flags. For instance, it complains if I \type in 'rm -rf *', since 'mv' doesn't have the -r flag and also can't move \across file partitions. How about the following csh hacks? You needn't use the `-rf' flags anymore, just type `rm directory'! alias rm 'set r=(\!* /); _rm' alias _rm 'if ($#r > 1) eval /bin/mv $r[1] ~/tmp \|\|'\ '/bin/cp -r $r[1] ~/tmp \&\& /bin/rm -r $r[1]\; shift r\; _rm' -- George Bush: |Maarten Litmaath @ VU Amsterdam: Capt. Slip of the Tongue |maart@cs.vu.nl, mcvax!botter!maart