Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!uwvax!uwmacc!hobbes!root
From: root@hobbes.UUCP (John Plocher)
Newsgroups: comp.unix.wizards
Subject: stupidity in directory management?
Message-ID: <156@hobbes.UUCP>
Date: Thu, 23-Jul-87 13:44:34 EDT
Article-I.D.: hobbes.156
Posted: Thu Jul 23 13:44:34 1987
Date-Received: Sat, 25-Jul-87 11:54:55 EDT
References: <8414@brl-adm.ARPA>
Reply-To: root@hobbes.UUCP (John Plocher)
Followup-To: comp.unix.wizards
Organization: U of Wisconsin - Madison  Spanish Department
Lines: 38

Didn't this go round about 8 months ago?  The solutions given then seem
to be usable now, too.  

From memory [so be warned that there ARE typos and whathaveyou here], here is
/usr/local/rm:

	 #! /bin/sh
	 if [ ! -d .kill ]
	 then
	     mkdir .kill
	 fi
	 mv $* .kill

also /usr/local/unrm:

	#! /bin/sh
	if [ ! -d .kill ]
	then
	    echo "There are no \"removed\" files to restore from"
	else			# DOES NOT HANDLE WILDCARDS or more than 1 arg
	    if [ ! -r .kill/$1 ]
	    then 
		echo "Sorry, the file " $1 "does not exist any more"
	    else
		mv .kill/$1 .
	    fi
	fi

in a user's .logout put the command to clean out all .kill files:
	
	find $HOME -type d -name .kill -exec /bin/rm -fr {} \;

Then state that files can be unrm'd UNTIL the user logs out, and not 
any later than that.  This is normal behavior on many systems that use
temp files which go poof when the user is done, and seems to follow
the rule of least astonishment.
-- 
John Plocher uwvax!geowhiz!uwspan!plocher  plocher%uwspan.UUCP@uwvax.CS.WISC.EDU