Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!rutgers!nike!oliveb!bene!luke!itkin From: itkin@luke.UUCP (Steven M. List) Newsgroups: net.unix Subject: Re: pipes within a 'find' command Message-ID: <159@luke.UUCP> Date: Fri, 3-Oct-86 11:51:45 EDT Article-I.D.: luke.159 Posted: Fri Oct 3 11:51:45 1986 Date-Received: Sat, 4-Oct-86 13:35:55 EDT References: <686@hplabsc.UUCP> Reply-To: itkin@luke.UUCP (Steven List) Distribution: na Organization: Benetics Corp, Mt.View, CA Lines: 25 Keywords: unix pipe find exec In article <686@hplabsc.UUCP> quan@hplabsc.UUCP (Suu Quan) writes: >This command did not work : >find /usr/spool/eroff -print -exec tbl {} | eqn | eroff -ms \; -exec rm {} \; > ^^^^^^^^^^^^^^^^^^^^^^^^ > The underlined pipe is to properly print a file. > >Intention : scan all the files in directory /usr/spool/eroff > print the file > remove the file. > >Problem : as is, the command does not work. How about my personal favorite: xargs... find /usr/spool/eroff -print | tee /tmp/jnk$$ | xargs -i@ tbl @ | eqn | eroff -ms ; rm -f `cat /tmp/jnk$$` /tmp/jnk$$ This is at least as fast as your find would have been using exec, and also provides more flexibility. -- *** * Steven List @ Benetics Corporation, Mt. View, CA * Just part of the stock at "Uncle Bene's Farm" * {cdp,engfocus,idi,oliveb,opusys,plx,pyramid,tolerant}!bene!luke!itkin ***