Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!orion.oac.uci.edu!drector From: drector@orion.oac.uci.edu (David Rector) Newsgroups: comp.unix.i386 Subject: Re: Interactive 2.2 File zapper. Message-ID: <26B3C8DE.23046@orion.oac.uci.edu> Date: 30 Jul 90 05:42:54 GMT References: <772@essnj1.ESSNJAY.COM> <7774@uudell.dell.com> <11@raysnec.UUCP> Organization: University of California, Irvine Lines: 33 In <11@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes: >jrh@mustang.dell.com (James Howard) writes: >>touch /lost+found >>find /lost+found -mtime +14 -exec rm -rf {} \; >/dev/null 2>&1 > ... except that touch will create a FILE if the entity does not > already exist. Better to do something like: > if [ -d /lost+found ]; do > find .... > fi Sorry, this doesn't work either. It has the same bug as 2.0.2; it will delete lost+found. Howard's fix will work if lost+found exists. If you want to be absolutely sure use something like if [ -d /lost+found ]; do touch /lost+found find ... else mkdir /lost+found fi This, of course, would also fail if /lost+found exists as a file. The pedantic may decorate the above accordingly. David Rector drector@orion.uci.edu Dept. of Math. U. C. Irvine, Irvine CA 92717 -- David L. Rector