From owner-freebsd-current Fri Apr 20 15:11:45 2001 Delivered-To: freebsd-current@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id 4584D37B43F for ; Fri, 20 Apr 2001 15:11:42 -0700 (PDT) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (msmith@localhost [127.0.0.1]) by mass.dis.org (8.11.2/8.11.2) with ESMTP id f3KMEAf06331; Fri, 20 Apr 2001 15:14:16 -0700 (PDT) (envelope-from msmith@mass.dis.org) Message-Id: <200104202214.f3KMEAf06331@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Jens Schweikhardt Cc: freebsd-current@freebsd.org Subject: Re: cp -d dir patch for review (or 'xargs'?) In-reply-to: Your message of "Fri, 20 Apr 2001 23:54:19 +0200." <20010420235419.B1276@schweikhardt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Apr 2001 15:14:10 -0700 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Folks, > > although there was much rejoicing, I think there's no need for a > new option to cp. Just use the toolbox, it's not too hard: > > (cat bigfilelist; echo destdir) | xargs cp > > Or even > > echo destdir >>bigfilelist > xargs cp < bigfilelist > > should do the trick. No, it won't. Consider a list of files a, b, c, d. You create input to xargs 'a b c d destdir', which it then splits into 'a b c' and 'd destdir'. The first time cp is run, it will probably fail; the second time only 'd' ends up where you expect it. The best solution to this is actually to fix xargs to accept a "command format string", eg. echo list | xargs "cp %s destdir" Probably a better way to do it would be to have the insertion marker an option to xargs: echo list | xargs -s LIST_HERE cp LIST_HERE destdir -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message