From owner-freebsd-questions Tue Nov 26 16:29:58 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 3DDD737B401 for ; Tue, 26 Nov 2002 16:29:57 -0800 (PST) Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E73A43EA9 for ; Tue, 26 Nov 2002 16:29:56 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id gAR0TrZK280666; Tue, 26 Nov 2002 19:29:53 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20021125221003.A19207@sylvester.dsj.net> References: <20021125221003.A19207@sylvester.dsj.net> Date: Tue, 26 Nov 2002 19:29:52 -0500 To: "David S. Jackson" , freebsd-questions@FreeBSD.ORG From: Garance A Drosihn Subject: Re: xargs -J Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) 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 At 10:10 PM -0500 11/25/02, 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. If you're using '-i' with GNU xargs, then you probably don't want '-J' on the xargs in freebsd. -J is meant to solve a problem that can not be handled via -I. >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? The man page for xargs says: Furthermore, only the first occurrence of the replstr will be replaced. in the description of -J. For your example, what you should use is -I, not -J. -- Garance Alistair Drosehn = gad@gilead.netel.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-questions" in the body of the message