Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hp-pcd!uoregon!omepd!intelisc!littlei!ogcvax!schaefer From: schaefer@ogcvax.UUCP (Barton E. Schaefer) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: rm * Message-ID: <1423@ogcvax.UUCP> Date: Fri, 18-Sep-87 15:13:37 EDT Article-I.D.: ogcvax.1423 Posted: Fri Sep 18 15:13:37 1987 Date-Received: Sun, 20-Sep-87 22:48:18 EDT References: <2830@lifia.UUCP> <591@euraiv1.UUCP> Reply-To: schaefer@ogcvax.UUCP (Barton E. Schaefer) Organization: Oregon Graduate Center, Beaverton, OR Lines: 70 Xref: mnetor comp.unix.wizards:4363 comp.unix.questions:4181 In article d757@sphinx.UUCP (Lawrence Lerner) writes: >#bye along with rm and unrm allows you to get rid of files temporarily and >#then flushes them when you log out normally. If you have not logged using >#the "bye" alias the files will not disappear. This is especially useful for >#system crashes. If you wish to retrieve them you can use >#unrm, this ONLY works if you have not yet logged out. Rm stores them in the >#limbo directory which you must first create in order to use these procedures. > >alias bye 'chmod 755 $HOME/limbo/.* >& /dev/null;chmod 755 $HOME/limbo/* >& /dev/null;\rm $HOME/limbo/.* >& /dev/null; \rm $HOME/limbo/* >& /dev/null;close limbo' > >alias rm 'mv \!* $HOME/limbo' >alias unrm 'mv $HOME/limbo/\!* $cwd' What is "close limbo" ? We have no such command here (VAX 11/780 UNIX 4.3 + NFS (U. of Wisc.)). And where's the "logout" in this alias? (Perhaps that's what "close" does?) Some other funnies in the "bye" alias: chmod 755 $HOME/limbo/.* changes the modes of . and .. \rm $HOME/limbo/.* attempts to rm . and .. The latter is OK only because rm won't do directories without the -r option. The former quietly changes the modes of $HOME ! What are the chmods for anyway? If it's to keep rm from asking about over- riding protections, why not use "\rm -f" ? And then there's what happens if you type rm -r some_directory with the "rm" alias above ... yup, you get an error message from mv. Ah, well, no easy way around the "rm -r" problem (except substituting a shell script for rm), but "bye" can be fixed up: # Hard quotes here make $HOME be expanded at execute time, not aliasing time alias bye 'source $HOME/.bye ; logout' in $HOME/.bye: # Cleanup, to be done only when the user logs out with "bye" /bin/rm -f $HOME/limbo/.??* >& /dev/null /bin/rm -f $HOME/limbo/* >& /dev/null close limbo # left because I don't know what it does I'd also suggest substituting a name beginning with "." for "limbo", e.g. ".limbo", so it won't normally show up in "ls" listings. If you don't like having the extra file ".bye", then do alias bye 'set flush_limbo ; logout' and in ".logout" put if ($?flush_limbo) then # stuff from .bye, above endif Incidentally, around here the default (new-user) ".cshrc" contains alias rm "rm -i" alias RM "/bin/rm" which catches most of the "rm *" problems without resorting to the mv-to-limbo technique. -- Bart Schaefer CSNET: schaefer@Oregon-Grad UUCP: ...{tektronix,verdix}!ogcvax!schaefer "Face it ... computers have revolutionized the workplace." "Right. The Ayatollah did the same thing to Iran." -- J. MacNelly