home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8025 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.4 KB  |  40 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!usc!wupost!darwin.sura.net!mlb.semi.harris.com!controls.ccd.harris.com!tvd
  3. From: tvd@ccd.harris.com (Tom Denham)
  4. Subject: find bug
  5. Message-ID: <1992Jul21.181917.749@ccd.harris.com>
  6. Organization: Harris Controls and Compositions
  7. Distribution: usa
  8. Date: Tue, 21 Jul 1992 18:19:17 GMT
  9. Lines: 29
  10.  
  11. From tvd Tue Jul 21 09:25:04 1992
  12. Subject: find
  13. To: nam (Noahal A. Mundt)
  14. Date: Tue, 21 Jul 92 9:25:04 EDT
  15. X-Mailer: ELM [version 2.3 PL11]
  16.  
  17. Noahal, I checked this out and I don't think it's true.
  18.  
  19. >I recently realized that /etc/skulker on my machines was not clearing out
  20. >/tmp and /etc.tmp as it should.  A bit of playing around and I discovered
  21. >that the problem is with find.  The following command, for instance:
  22.  
  23. >  find /tmp -mtime +1 -type f -exec /bin/rm {} \;
  24.  
  25. >This should find all the matching files and delete them-- however, find
  26. >seems to replace the {}'s with the cwd instead of the name of the file it
  27. >finds.  Is this the way find is supposed to work?  If so, how would I
  28. >go about automatically deleting files, short of redirecting output from find
  29. >(which I could do, but would require a bit of work).  Any help
  30. >would be appreciated.
  31.  
  32. I tried the following command and it found only files, not directories:
  33.  
  34.  
  35.    find /tmp -mtime +1 -type f -exec /bin/ls {} \;
  36.  
  37. The only thing I changed is the rm command.
  38. It seems to me the {} is working correctly.  Maybe I missed something?
  39. --
  40.