home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sun / admin / 10831 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.6 KB  |  54 lines

  1. Newsgroups: comp.sys.sun.admin
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!paladin.american.edu!darwin.sura.net!haven.umd.edu!wam.umd.edu!awills
  3. From: awills@wam.umd.edu (Andrew F. Wills)
  4. Subject: Re: Help with FIND in shell script
  5. Message-ID: <1993Jan27.034446.12782@wam.umd.edu>
  6. Sender: usenet@wam.umd.edu (USENET News system)
  7. Nntp-Posting-Host: rac3.wam.umd.edu
  8. Organization: University of Maryland, College Park
  9. References: <1k4gp8INN8ei@darkstar.UCSC.EDU>
  10. Date: Wed, 27 Jan 1993 03:44:46 GMT
  11. Lines: 41
  12.  
  13. In article <1k4gp8INN8ei@darkstar.UCSC.EDU> stephen@orchid.UCSC.EDU (coram populo) writes:
  14. >Can someone give me an idea on how to make the find command use
  15. >the {} in the -exec usage.
  16. >
  17. >For example, I want to mail users automagically when their mail
  18. >in the system spool is over a particular size.
  19. >
  20. >e.g. as I wrote it -
  21. >
  22. >find * -size 100000c -exec mail {} < ./mailmessage \;
  23. >
  24. >But this does not work- it never finds the < ./mailmessage part.
  25. >
  26. >Thanks in advance for suggestions etc.
  27. >
  28. >Stephen Hauskins
  29. >UCSC
  30.  
  31. Try making a general purpose shell script that runs the mail command
  32. with the {} that you desire passed into it as a parameter.
  33.  
  34. e.g.:
  35.  
  36. find * -size 100000c -exec emergency_mailer {} \;
  37.  
  38. emergency_mailer
  39. ----------------
  40. mail $1 < ./mailmessage
  41. [EOF]
  42.  
  43. Something like this should server your purposes quite well.  I haven't
  44. checked all the idiosycratic niceties of the example I've given, but 
  45. you should be able to get the idea.
  46.  
  47. Andy Wills
  48. The MITRE Corporation
  49. Command Center Engineering Lab
  50. awills@mwunix.mitre.org
  51.  
  52. Of course this is my own opinion, so don't blame me.
  53.  
  54.