From owner-freebsd-questions Mon Nov 25 19:51:19 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD73137B401 for ; Mon, 25 Nov 2002 19:51:17 -0800 (PST) Received: from sub21-156.member.dsl-only.net (sub21-156.member.dsl-only.net [63.105.21.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7052E43E88 for ; Mon, 25 Nov 2002 19:51:17 -0800 (PST) (envelope-from nkinkade@sub21-156.member.dsl-only.net) Received: from nkinkade by sub21-156.member.dsl-only.net with local (Exim 4.10) id 18GWkh-0003r4-00 for freebsd-questions@freebsd.org; Mon, 25 Nov 2002 19:51:11 -0800 Date: Mon, 25 Nov 2002 19:51:11 -0800 From: Nathan Kinkade To: freebsd-questions@freebsd.org Subject: Re: xargs -J Message-ID: <20021126035111.GB14336@sub21-156.member.dsl-only.net> Reply-To: nkinkade@dsl-only.net Mail-Followup-To: freebsd-questions@freebsd.org References: <20021125221003.A19207@sylvester.dsj.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021125221003.A19207@sylvester.dsj.net> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Nov 25, 2002 at 10:10:03PM -0500, David S. Jackson wrote: > Hi, > > I've been trying to use |xargs -J [] mv [] [].suffix > > but to no avail. > > I've tried |xargs -J mv \[\] \[\].suffix and variations but that > doesn't seem to work either. It seems to work fine with the -i > command under GNU xargs, but not under Freebsd. > > An example would be > > $ touch one two three > $ ls one two three | xargs -J [] mv [] [].suffix > > I should now have one.suffix two.suffix three.suffix. At least, > that's what happens with GNU and the -i \{\}. (FreeBSD manpage says > to use -J [] without escapes though.) > > Can anyone lend me a clue here please? > > TIA. > > -- > David S. Jackson dsj@dsj.net Two things. First, from `man xargs`: "Furthermore, only the first occurrence of the replstr will be replaced." Second, maybe a different tool would be better. How about: $ for file in `ls one two three`; do move $file $file.suffix; done Nathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message