On Sat, 21 Apr 2001, Brian Somers wrote:

> > On Sat, 21 Apr 2001 14:06:04 +0100, Brian Somers wrote:
> > 
> > > How do you do this in a script:
> > > 
> > >   cd /topdir; find . -type f | xargs -i {} cp {} /otherdir/.
> > 
> > for i in `find /path/to/source -type f`; do
> >     cp $i /path/to/dest/
> > done
> > 
> > What's all the fuss about?
> 
> Have you tried that for values of /path/to/source with lots of files ?
> Something like
> 
>   find blah | while read i; do cp $i /dest/.; done
> 
> is better, but it runs cp too many times.

cp is a bad example, since it usually does physical i/o which is much 
slower than execve() of a program that is probably cached, especially
when the program is small and not dynamically linked.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to