From owner-freebsd-current Sat Apr 21 12: 0: 2 2001 Delivered-To: freebsd-current@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 2056F37B43C for ; Sat, 21 Apr 2001 11:59:52 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f3LIvrb79728; Sat, 21 Apr 2001 19:57:53 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f3LIug547373; Sat, 21 Apr 2001 19:56:42 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200104211856.f3LIug547373@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Sheldon Hearn Cc: Brian Somers , "Rodney W. Grimes" , bsd@bsdhome.com (Brian Dean), schweikh@schweikhardt.net (Jens Schweikhardt), freebsd-current@freebsd.org, brian@Awfulhak.org Subject: Re: cp -d dir patch for review (or 'xargs'?) In-Reply-To: Message from Sheldon Hearn of "Sat, 21 Apr 2001 16:22:44 +0200." <93802.987862964@axl.fw.uunet.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 21 Apr 2001 19:56:42 +0100 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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. > Ciao, > Sheldon. -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message