From owner-freebsd-hackers Sat May 12 3:37:59 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 1CEA637B423 for ; Sat, 12 May 2001 03:37:51 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 52759 invoked by uid 1000); 12 May 2001 10:37:14 -0000 Date: Sat, 12 May 2001 13:37:14 +0300 From: Peter Pentchev To: Brian Somers Cc: Dima Dorfman , hackers@FreeBSD.ORG, gad@FreeBSD.ORG Subject: Re: xargs(1) "replstr" patch Message-ID: <20010512133714.A52713@ringworld.oblivion.bg> Mail-Followup-To: Brian Somers , Dima Dorfman , hackers@FreeBSD.ORG, gad@FreeBSD.ORG References: <200105121004.f4CA4gX91830@hak.lan.Awfulhak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105121004.f4CA4gX91830@hak.lan.Awfulhak.org>; from brian@Awfulhak.org on Sat, May 12, 2001 at 11:04:42AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Seconded :) G'luck, Peter -- Do you think anybody has ever had *precisely this thought* before? On Sat, May 12, 2001 at 11:04:42AM +0100, Brian Somers wrote: > I'd suggest going ahead and committing it ASAP - before people start > ``discussing'' it again :oI > > Feel free to blame me for reviewing it !!! > > > Folks, > > > > The attached patch adds a "replacement string" feature to xargs(1). > > There's a full description in the man page update (also attached), but > > the following should demonstrate the new functionality: > > > > dima@spike% ./xargs -J [] echo CMD LINE [] ARGS < test > > CMD LINE this is the contents of the test file ARGS > > dima@spike% ./xargs -J [] echo CMD [] LINE ARGS < test > > CMD this is the contents of the test file LINE ARGS > > dima@spike% ./xargs -J [] echo [] CMD LINE ARGS < test > > this is the contents of the test file CMD LINE ARGS > > > > This is similar to, but not identical to, the -I option described in > > SUSv2. The latter allows the replstr ("[]" above) to be attached to > > other arguments, and appear multiple times. Furthermore, it implies > > '-n 1'. Although the features are similar, they can solve different > > problems; even if -I is implemented later, this (-J) would still be > > useful. -J also doesn't have the performance implications attached > > with -I. > > > > There was a nice, long thread about this on current a few weeks ago > > (topic: "Re: cp -d dir patch for review (or 'xargs'?)"). It was > > rather inconclusive, but nobody managed to come up with a way to > > *properly* and *easily* imitate this functionality. Writing a script > > to do this *properly* (i.e., handle environment growth) isn't as easy > > as it sounds (although it's possible, of course). > > > > The patch is a joint effort between myself and Garance Dorsihn (gad). > > > > Comments? Suggestions? > > > > Thanks in advance, > > > > Dima Dorfman > > dima@unixfreak.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message