From owner-freebsd-current Fri Apr 20 1:36:22 2001 Delivered-To: freebsd-current@freebsd.org Received: from bsdone.bsdwins.com (www.bsdwins.com [192.58.184.33]) by hub.freebsd.org (Postfix) with ESMTP id 3B2F037B424 for ; Fri, 20 Apr 2001 01:36:17 -0700 (PDT) (envelope-from jwd@bsdwins.com) Received: (from jwd@localhost) by bsdone.bsdwins.com (8.11.1/8.11.0) id f3K8ZwE82145; Fri, 20 Apr 2001 04:35:59 -0400 (EDT) (envelope-from jwd) Date: Fri, 20 Apr 2001 04:35:58 -0400 From: "John W. De Boskey" To: Garance A Drosihn Cc: Dima Dorfman , Current List , wollman@khavrinen.lcs.mit.edu Subject: Re: cp -d dir patch for review (or 'xargs'?) Message-ID: <20010420043558.A81959@bsdwins.com> References: <20010420050842.E8EA93E2F@bazooka.unixfreak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from drosih@rpi.edu on Fri, Apr 20, 2001 at 01:57:01AM -0400 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If you just want an xargs that supports --replstr/-i simply install: ftp://ftp.gnu.org/gnu/findutils or even more easily: /usr/ports/misc/findutils two comments: I don't want to enter a protracted discussion over the benefits/drawbacks of the current xargs vs an updated xargs, nor try to do a write-from-scratch. The cp -d option has runtime execution of O(1). Xargs addes O(n) due to it's manipulation of the arguement vector in -i mode. The process I'm dealing with already takes many hours to run. I want to reduce time, not increase it. Comments welcome. -john ----- Garance A Drosihn's Original Message ----- > At 10:08 PM -0700 4/19/01, Dima Dorfman wrote: > >Garance A Drosihn writes: > > > Or maybe something to indicate where the list of arguments > >> should go in a command. Hrm. Let's say '-Y replstr' or > >> '-y[replstr]' (no blank after -y). If no [replstr] is > >> given on -y, it defaults to the two characters '[]'. > >> Then one might do: > >> cat big_file_list | xargs -y cp [] target_directory > > > >This is a great idea! I'm willing to implement it if nobody > >else wants to. > > Woo-hoo! Someone to do the work! Yes! > > > > you're trying to address. On the other hand, the man page > >> for 'xargs' on FreeBSD says: > >> > >> The xargs utility is expected to be IEEE Std 1003.2 > >> (``POSIX.2'') compliant. > >> > >> so I don't know how we go about adding options to it. On > >> the other hand, that same issue is faced by adding options > >> to 'cp', as there is a similar claim made in cp's man page. > > > >I don't think it's a problem. We're adding new options here, not > >changing--sometimes known as breaking--what already exists. I'm > >pretty sure that the standards don't say anything to the effect of, > >"You must support this and nothing else." That'd be rather silly. > > Actually, it's not as silly as it sounds. If you're writing > scripts, and you use those extra parameters, then you'll get > into trouble when running the script on some other POSIX-based > OS which does not have these new options. > > I really do like the idea of both the -I/-i options from solaris, > and the -Y/-y options that I just dreamed up, but I'm not sure > what the right procedure is to introduce them (and eventually > have them standard everywhere... :-). Maybe we could initially > have a 'yargs' command, which is just like 'xargs' except that > it adds those four options. Maybe I'm just overly pedantic. > > Hmm. Checking my copy of "Single Unix Specification, v2", the > -I/-i parameters are defined in THAT standard, but it doesn't > have anything matching my -Y/-y suggestion. Hmm, I wonder if > I should be copying this "meta-question" to the mailing list > for standardizing things... > > -- > Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message