Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!eecae!cps3xx!cps3xx.egr.msu.edu!ben From: ben@nsf1.mth.msu.edu (Ben Lotto) Newsgroups: comp.unix.questions Subject: Re: files recovery after rm? Message-ID: Date: 9 Nov 89 15:31:12 GMT References: <16608@uhnix1.uh.edu> <20530@unix.cis.pitt.edu> Sender: usenet@cps3xx.UUCP Reply-To: ben@nsf1.mth.msu.edu Organization: Michigan State University Lines: 44 In-reply-to: yahoo@unix.cis.pitt.edu's message of 9 Nov 89 01:08:17 GMT >>>>> On 9 Nov 89 01:08:17 GMT, yahoo@unix.cis.pitt.edu (Kenneth L Moore) said: Kenneth> I use the following aliases in my .tshrc and .cshrc Kenneth> alias rm 'mv -f \!:* /tmp' alias unrm 'mv /tmp/\!:* .' Kenneth> Note that \!:* allows for the use of variable names. By the way, the \!:* is not sound for the unrm command. If you tried 'unrm a b c', it would execute 'mv /tmp/a b c .'. Perhaps some sort of for loop would work? Here's what I use. It's similar to the above. In my .login file: setenv RMDIR .RM$$ mkdir $HOME/$RMDIR chmod 700 $HOME/$RMDIR In .cshrc: alias rm 'mv \!* $HOME/$RMDIR' alias unrm 'mv $HOME/$RMDIR/\!$ .' And in .logout: find /home/brain/ben/.RM* -prune \ -atime +1 -exec /bin/rm -rf {} \; >>& $HOME/LOGOUT.log & The advantages of this over the other method: every login shell gets its own removal directory, the removal directories are private, there is no clash between users if many users are using the same methods. The disadvantages: disk space gets charged to you. Question 1: what are the other advantages and disadvantages of these approaches? Question 2: is there any difference between \!* and \!:*? -- -B. A. Lotto (ben@nsf1.mth.msu.edu) Department of Mathematics/Michigan State University/East Lansing, MI 48824