Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!phoenix!subbarao From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Newsgroups: news.newusers.questions Subject: Re: alias rm to write to trash directory Message-ID: <13698@phoenix.Princeton.EDU> Date: 8 Feb 90 15:23:40 GMT References: Reply-To: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Lines: 40 In article broadman@paul.rutgers.edu (Allen Broadman) writes: > >I would like to have my RM command actually write >files to a directory TRASH, which I could periodically empty. > >1) Is there an easy way to this? Sure -- Just takes a Little Shell Script. >2) Is there a way to be reminded to empty the TRASH directory upon > logging out? Is there an analagous file to .login (.logout perhaps)? Yep -- You guessed it! Here you are --- Script that puts trash in ~/Trash (or whatever you set it to) !# /bin/csh -f set trash = "~/Trash" while ($#argv) mv -i $argv[1] $trash # Moves it to the Trash Directory shift # Next file end Also, put this in your .logout /bin/rm ~Trash/* echo "Trash Emptied" And thats it! An Up and Coming Unix Personality Kartik Subbarao