home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.admin
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!paladin.american.edu!darwin.sura.net!haven.umd.edu!wam.umd.edu!awills
- From: awills@wam.umd.edu (Andrew F. Wills)
- Subject: Re: Help with FIND in shell script
- Message-ID: <1993Jan27.034446.12782@wam.umd.edu>
- Sender: usenet@wam.umd.edu (USENET News system)
- Nntp-Posting-Host: rac3.wam.umd.edu
- Organization: University of Maryland, College Park
- References: <1k4gp8INN8ei@darkstar.UCSC.EDU>
- Date: Wed, 27 Jan 1993 03:44:46 GMT
- Lines: 41
-
- In article <1k4gp8INN8ei@darkstar.UCSC.EDU> stephen@orchid.UCSC.EDU (coram populo) writes:
- >Can someone give me an idea on how to make the find command use
- >the {} in the -exec usage.
- >
- >For example, I want to mail users automagically when their mail
- >in the system spool is over a particular size.
- >
- >e.g. as I wrote it -
- >
- >find * -size 100000c -exec mail {} < ./mailmessage \;
- >
- >But this does not work- it never finds the < ./mailmessage part.
- >
- >Thanks in advance for suggestions etc.
- >
- >Stephen Hauskins
- >UCSC
-
- Try making a general purpose shell script that runs the mail command
- with the {} that you desire passed into it as a parameter.
-
- e.g.:
-
- find * -size 100000c -exec emergency_mailer {} \;
-
- emergency_mailer
- ----------------
- mail $1 < ./mailmessage
- [EOF]
-
- Something like this should server your purposes quite well. I haven't
- checked all the idiosycratic niceties of the example I've given, but
- you should be able to get the idea.
-
- Andy Wills
- The MITRE Corporation
- Command Center Engineering Lab
- awills@mwunix.mitre.org
-
- Of course this is my own opinion, so don't blame me.
-
-