From owner-freebsd-current Sat Apr 21 8: 3:11 2001 Delivered-To: freebsd-current@freebsd.org Received: from lists01.iafrica.com (lists01.iafrica.com [196.7.0.141]) by hub.freebsd.org (Postfix) with ESMTP id 3FCCE37B423 for ; Sat, 21 Apr 2001 08:03:07 -0700 (PDT) (envelope-from sheldonh@uunet.co.za) Received: from nwl.fw.uunet.co.za ([196.31.2.162]) by lists01.iafrica.com with esmtp (Exim 3.12 #2) id 14qyrK-00037C-00; Sat, 21 Apr 2001 16:59:38 +0200 Received: (from nobody@localhost) by nwl.fw.uunet.co.za (8.8.8/8.6.9) id QAA11897; Sat, 21 Apr 2001 16:59:37 +0200 (SAST) Received: by nwl.fw.uunet.co.za via recvmail id 11796; Sat Apr 21 16:58:48 2001 Received: from sheldonh (helo=axl.fw.uunet.co.za) by axl.fw.uunet.co.za with local-esmtp (Exim 3.22 #1) id 14qyqW-00037j-00; Sat, 21 Apr 2001 16:58:48 +0200 To: Alexander Kabaev Cc: freebsd-current@freebsd.org, schweikh@schweikhardt.net (Jens Schweikhardt), bsd@bsdhome.com (Brian Dean), "Rodney W. Grimes" , Brian Somers Subject: Re: cp -d dir patch for review (or 'xargs'?) In-reply-to: Your message of "Sat, 21 Apr 2001 10:52:05 -0400." Date: Sat, 21 Apr 2001 16:58:48 +0200 Message-ID: <12006.987865128@axl.fw.uunet.co.za> From: Sheldon Hearn Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 21 Apr 2001 10:52:05 -0400, Alexander Kabaev wrote: > > for i in `find /path/to/source -type f`; do > > cp $i /path/to/dest/ > > done > > > > What's all the fuss about? > > It looks like above construct will fail horribly if any of the files in /topdir > have names with spaces in them. Think MP3 collections :) Your comments have nothing to do with the issue at hand. Just wrap the first argument to cp in double-quotes, i.e. cp "$i" The point is, why bastardize tools to cope with areas beyond their focus and well within the focus of other tools? Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message