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

  1. Newsgroups: comp.sys.sun.admin
  2. Path: sparky!uunet!inmos!inmos.co.uk!brwal!hughm
  3. From: hughm@brwal.inmos.co.uk (Hugh McIntyre)
  4. Subject: Re: Help with FIND in shell script
  5. Message-ID: <1993Jan28.133428.20422@inmos.co.uk>
  6. Sender: news@inmos.co.uk
  7. Organization: INMOS Limited, Bristol, UK
  8. References:  <1k4gp8INN8ei@darkstar.UCSC.EDU>
  9. Date: Thu, 28 Jan 1993 13:34:28 GMT
  10. Lines: 34
  11.  
  12. In article <1k4gp8INN8ei@darkstar.UCSC.EDU>, stephen@orchid.UCSC.EDU (coram populo) writes:
  13. |> Can someone give me an idea on how to make the find command use
  14. |> the {} in the -exec usage.
  15. |> 
  16. |> For example, I want to mail users automagically when their mail
  17. |> in the system spool is over a particular size.
  18.  
  19. Sounds like a good way to fill up the filesystem if they don't read their mail
  20. since the mailbox will just keep getting bigger and bigger every time a warning
  21. message is added ...
  22.  
  23. |> e.g. as I wrote it -
  24. |> 
  25. |> find * -size 100000c -exec mail {} < ./mailmessage \;
  26. |> 
  27. |> But this does not work- it never finds the < ./mailmessage part.
  28.  
  29. You may need a script mailwarn, eg:
  30.  
  31. -------------------------------
  32. #! /bin/sh
  33. #
  34. mail $* < ./mailmessage $1
  35. -------------------------------
  36.  
  37. find * -size 100000c -exec ./mailwarn {} \;
  38.  
  39. |> Thanks in advance for suggestions etc.
  40. |> 
  41. |> Stephen Hauskins
  42. |> UCSC
  43.  
  44. Hugh McIntyre.
  45. INMOS, Bristol, UK.
  46.