home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8064 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.1 KB

  1. Path: sparky!uunet!psinntp!curly.appmag.com!pa
  2. From: pa@curly.appmag.com (Pierre Asselin)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: skulker/find problem
  5. Message-ID: <1195@curly.appmag.com>
  6. Date: 21 Jul 92 15:54:45 GMT
  7. References: <1992Jul20.180100.2522@terminator.cc.umich.edu>
  8. Organization: Applied Magnetics, Goleta, CA
  9. Lines: 22
  10.  
  11. In <1992Jul20.180100.2522@terminator.cc.umich.edu> kens@psc.lsa.umich.edu (Ken Small) writes:
  12.  
  13. >  find /tmp -mtime +1 -type f -exec /bin/rm {} \;
  14.  
  15. >This should find all the matching files and delete them-- however, find
  16. >seems to replace the {}'s with the cwd instead of the name of the file it 
  17. >finds.
  18.  
  19. I just tried
  20.  
  21.   find /tmp -mtime +1 -type f -exec /bin/echo {} \;
  22.  
  23. and it worked OK.  Check yout /tmp for files with funny names, for
  24. example a with leading blank.
  25.  
  26. Hem.  Does "find -exec cmd" spawn a shell or does it fork()/execvp()
  27. the cmd directly?  If it does the latter, it should be relatively
  28. immune to strange file names.
  29. -- 
  30.  
  31. --Pierre Asselin, Magnetoresistive Head Engineering, Applied Magnetics.
  32.   pa@appmag.com        the usual disclaimers apply.
  33.