Semi-OT: Problems getting find to not recurse

2005-07-06 Thread C. Bensend
Hey folks, OK, I think I've got the dunce hat on today, and I'm about to go crazy with this one. I have a script on an OpenBSD 3.7-STABLE machine that does a find in a directory, and uses rm to remove files older than two days (where RETAIN = +2) : find /path/to/dir -type f -name \*.gz

Re: Semi-OT: Problems getting find to not recurse

2005-07-06 Thread Otto Moerbeek
On Wed, 6 Jul 2005, C. Bensend wrote: Hey folks, OK, I think I've got the dunce hat on today, and I'm about to go crazy with this one. I have a script on an OpenBSD 3.7-STABLE machine that does a find in a directory, and uses rm to remove files older than two days (where RETAIN =

Re: Semi-OT: Problems getting find to not recurse

2005-07-06 Thread C. Bensend
Something like this should work (compare some of th examples of the man page): find /path/to/dir -name .ssh -type d -prune -or \ -type f -name \*.gz -mtime ${RETAIN} -exec rm {} \; Thank you very much, Otto. That works just fine. It's greatly appreciated! Benny -- I'd rather

Re: Semi-OT: Problems getting find to not recurse

2005-07-06 Thread Matthias Kilian
On Wed, Jul 06, 2005 at 02:33:30PM -0500, C. Bensend wrote: find /path/to/dir -name .ssh -type d -prune -or \ -type f -name \*.gz -mtime ${RETAIN} -exec rm {} \; Thank you very much, Otto. That works just fine. It's greatly appreciated! Well, even if it helped, I can't reproduce

Re: Semi-OT: Problems getting find to not recurse

2005-07-06 Thread Otto Moerbeek
On Wed, 6 Jul 2005, Matthias Kilian wrote: On Wed, Jul 06, 2005 at 02:33:30PM -0500, C. Bensend wrote: find /path/to/dir -name .ssh -type d -prune -or \ -type f -name \*.gz -mtime ${RETAIN} -exec rm {} \; Thank you very much, Otto. That works just fine. It's greatly appreciated!

Re: Semi-OT: Problems getting find to not recurse

2005-07-06 Thread Steffen Kluge
On Wed, 2005-07-06 at 22:19 +0200, Matthias Kilian wrote: find /home/kili -maxdepth 1 -type f -name \* -mtime +1 -exec echo {} \; | grep ssh This test is irrelevant to the OP's problem. yields no output at all. [And of course, I *do* have a .ssh directory.] But do you have *files* (-type f)