From owner-freebsd-current Fri Apr 20 21: 1:11 2001 Delivered-To: freebsd-current@freebsd.org Received: from gndrsh.dnsmgr.net (GndRsh.dnsmgr.net [198.145.92.4]) by hub.freebsd.org (Postfix) with ESMTP id 5F84A37B422 for ; Fri, 20 Apr 2001 21:01:07 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.9.3/8.9.3) id VAA69212; Fri, 20 Apr 2001 21:00:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <200104210400.VAA69212@gndrsh.dnsmgr.net> Subject: Re: cp -d dir patch for review (or 'xargs'?) In-Reply-To: <20010420223943.A59039@vger.bsdhome.com> from Brian Dean at "Apr 20, 2001 10:39:43 pm" To: bsd@bsdhome.com (Brian Dean) Date: Fri, 20 Apr 2001 21:00:56 -0700 (PDT) Cc: schweikh@schweikhardt.net (Jens Schweikhardt), freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Fri, Apr 20, 2001 at 07:26:18PM -0700, Rodney W. Grimes wrote: > > > > (cat bigfilelist; echo destdir) | xargs cp > > > > I like this version of the patch!! It's much much cleaner than > > hacking up cp or xargs, it even follows the unix principle of > > using simple tools and glueing them togeather to do bigger > > jobs, is unix implementation independent, and is very clear > > in what it does. > > It's clean, simple, and unfortunately, totally bogus. > > Try: > > echo 1 2 3 4 5 6 7 8 9 | xargs -n 4 echo > > Now consider what would happen with the above suggested construct with > a very long file list. bleck... try this for your sample: $ (echo 1 2 3 4 5 6 7 8 9 | xargs -n 4) | while read x; do > echo -n $x; echo " dst" > done 1 2 3 4 dst 5 6 7 8 dst 9 dst $ > > I don't see a problem with adding an option to cp to treat the first > argument as the target instead of the last argument. It's a simple > solution, the code change is simple, and it produces the exact desired > result. What's the problem? It's yet another non-portable option. -- Rod Grimes - KD7CAX @ CN85sl - (RWG25) rgrimes@gndrsh.dnsmgr.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message