Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1+some 2/3/84; site dual.UUCP
Path: utzoo!linus!decvax!decwrl!amd!dual!fair
From: fair@dual.UUCP (Erik E. Fair)
Newsgroups: net.unix
Subject: Re: creating pipes in find(1)
Message-ID: <821@dual.UUCP>
Date: Mon, 1-Oct-84 23:31:27 EDT
Article-I.D.: dual.821
Posted: Mon Oct  1 23:31:27 1984
Date-Received: Wed, 3-Oct-84 06:21:11 EDT
References: <12378@sri-arpa.UUCP>
Organization: Dual Systems, Berkeley, CA
Lines: 40

>> From: tcs%usna.uucp@BRL-BMD.ARPA
>> Newsgroups: net.unix
>> Subject: creating pipes in find(1)
>> Date: Tue, 25-Sep-84 11:51:16 PDT
>> 
>> How do I build a pipe within the exec portion of find?
>> Example:
>> 	find /etc -name printcap -exec cat {} | lpr \;
>> 
>> I've tried lots of combinations of escaped parens, exec'ing
>> the shell, etc and nothing works.
>> I have gotten this to work:
>> 	find /tmp -name tobuy -exec junk1 {} \;
>> 
>> junk1:
>> 	cat $1 | more
>> 
>> But I'd rather know how to do it without having another file
>> lying around.
>> 
>> If it can be done, please explain the combination of
>> escapes, etc you use make it work.  Thanks.
>> 	-tcs
>> 	Terry Slattery	  U.S. Naval Academy	301-267-4413
>> 	ARPA: tcs@brl-bmd     UUCP: decvax!brl-bmd!usna!tcs

I think what you want is something like this:

find / -perm -4000 -exec ls -ls {} \; | Mail -s "Daily SUID Program Report" root

Note the escaped semi-colon? That's part of the argument list to find(1).
That's what terminates an exec list. Since the semi-colon is escaped,
the shell (whichever one you use) will not use it to terminate the command.
Clear?

	Erik E. Fair	ucbvax!fair	fair@ucb-arpa.ARPA

	dual!fair@BERKELEY.ARPA
	{ihnp4,ucbvax,hplabs,decwrl,cbosgd,sun,nsc,apple,pyramid}!dual!fair
	Dual Systems Corporation, Berkeley, California