pipes within a 'find' command
Steven M. List
itkin at luke.UUCP
Sat Oct 4 01:51:45 AEST 1986
In article <686 at hplabsc.UUCP> quan at 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
***
More information about the Comp.unix
mailing list