From owner-freebsd-hackers Sat May 12 3: 4:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 1597137B424; Sat, 12 May 2001 03:04:50 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4CA4i398494; Sat, 12 May 2001 11:04:44 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4CA4gX91830; Sat, 12 May 2001 11:04:42 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200105121004.f4CA4gX91830@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Dima Dorfman Cc: hackers@FreeBSD.ORG, gad@FreeBSD.ORG, brian@Awfulhak.org Subject: Re: xargs(1) "replstr" patch In-Reply-To: Message from Dima Dorfman of "Fri, 11 May 2001 18:03:19 PDT." <20010512010319.B3B893E0B@bazooka.unixfreak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 12 May 2001 11:04:42 +0100 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 [.....] -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message