Date: Sat, 21 Apr 2001 19:56:42 +0100 From: Brian Somers <brian@Awfulhak.org> To: Sheldon Hearn <sheldonh@uunet.co.za> Cc: Brian Somers <brian@Awfulhak.org>, "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>, 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'?) Message-ID: <200104211856.f3LIug547373@hak.lan.Awfulhak.org> In-Reply-To: Message from Sheldon Hearn <sheldonh@uunet.co.za> of "Sat, 21 Apr 2001 16:22:44 %2B0200." <93802.987862964@axl.fw.uunet.co.za>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <brian@Awfulhak.org> <brian@[uk.]FreeBSD.org> <http://www.Awfulhak.org> <brian@[uk.]OpenBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104211856.f3LIug547373>