Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!quintus!sun!pitstop!sundc!seismo!uunet!munnari!moncskermit!goanna!yabbie!cit5!root
From: root@cit5.oz (Steve Balogh)
Newsgroups: comp.unix.wizards
Subject: Re: globbing in the shell (Was Re: more rm insanity)
Summary: A simple solution?
Message-ID: <210@cit5.oz>
Date: 9 Dec 87 08:35:45 GMT
References: <1257@boulder.Colorado.EDU> <6840002@hpcllmv.HP.COM> <9555@mimsy.UUCP> <890@russell.STANFORD.EDU> <9610@mimsy.UUCP> <8146@ism780c.UUCP>
Reply-To: steve@cit5.oz (Steve Balogh)
Organization: Chisholm Institute of Technology, Melb, Australia
Lines: 40

I have overcome the problem of accidently deleting a whole directory of files
(after accidently doing it to my home directory ONCE only) by doing the
following....

1.	I have set up a bin directory under my home directory which contains
	commands and programs which I use on a regular basis.

2.	I have changed my PATH to include $HOME/bin as the FIRST entry (or
	at least BEFORE /bin ).

3.	I have included a set of programs which simulates a trashcan by making
	a directory called $HOME/.TRASH and creating the following scripts:
	rm		will do a mv from current directory to $HOME/.TRASH
	rummage		will do an ls of $HOME/.TRASH
	scavange	will retrieve an accidently rm'ed file
	empty		will REALLY remove all files from $HOME/.TRASH

4.	I automatically perform an "empty" command when logging out. (it
	could be said that this is dangerous, but it is a risk that I am
	willing to take so as to not make the .TRASH directory too big) It
	could be done manually on a regular basis.

This system has saved many files which would have been accidently deleted and
sometimes also serves as a place to put temporary files. (although this is not
really recommended) I believe that the mv command only changes file pointers
and does not actually copy a file, so even large files can be removed quickly
with this method.

I am sure that there are better and more exotic ways of solving the "rm *"
problem but I find that the above works well for me.

					Steve.

-		-		-		-		-
		(It's my opinion and not my employers)
Steve Balogh	VK3YMY			| steve@cit5.cit.oz (...oz.au)
Chisholm Institute of Technology	| steve%cit5.cit.oz@uunet.uu.net
PO Box 197, Caulfield East		| 
Melbourne, AUSTRALIA. 3145		| {hplabs,mcvax,uunet,ukc}!munnari\
+61 3 573 2266 (Ans Machine)		|  !cit5.cit.oz!steve