Path: utzoo!attcan!uunet!husc6!mailrus!ames!ucsd!nprdc!bickel From: bickel@nprdc.arpa (Steven Bickel) Newsgroups: comp.unix.wizards Subject: Re: fixing rm * Summary: mv aliased Message-ID: <1069@arctic.nprdc.arpa> Date: 18 Nov 88 22:29:10 GMT References: <1232@atari.UUCP> <564@comdesign.CDI.COM> <1670@ski.cs.vu.nl> Sender: news@nprdc.arpa Reply-To: bickel@nprdc.arpa (Steven Bickel) Organization: Navy Personnel R&D Center, San Diego Lines: 25 # aliasing rm to this simple shell script should solve all rm problems # providing you have some extra disk space and the rm_purge alias is executed # regularly ie. in a .login file. It will currently purge all files from # the removal directory after 21 days. # remove script num=0; for i in $@ do if test -r $i then chmod 777 $i; rm_dir="/usr/tmp/rmtmp/$i"; echo "moved" $i $rm_dir ; mv $i $rm_dir; num=num+1; fi done alias rm_purge "find /usr/tmp/rmtmp/ -name '*' -print -atime +21 -exec rm -r '{}' \;" Steve Bickel bickel@nprdc.arpa Systems Engineering Assoc. (619) 553-9306 Naval Personel R & D Center.