From owner-freebsd-questions Mon Nov 25 21:57:46 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 B3DDD37B401 for ; Mon, 25 Nov 2002 21:57:44 -0800 (PST) Received: from ip68-14-62-49.no.no.cox.net (ip68-14-62-49.no.no.cox.net [68.14.62.49]) by mx1.FreeBSD.org (Postfix) with ESMTP id 072D243EC2 for ; Mon, 25 Nov 2002 21:57:44 -0800 (PST) (envelope-from conrads@cox.net) Received: from ip68-14-62-49.no.no.cox.net (localhost [127.0.0.1]) by ip68-14-62-49.no.no.cox.net (8.12.6/8.12.6) with ESMTP id gAQ5vfoA036906; Mon, 25 Nov 2002 23:57:41 -0600 (CST) (envelope-from conrads@ip68-14-62-49.no.no.cox.net) Received: (from conrads@localhost) by ip68-14-62-49.no.no.cox.net (8.12.6/8.12.6/Submit) id gAQ5vZgA036905; Mon, 25 Nov 2002 23:57:35 -0600 (CST) (envelope-from conrads) Message-ID: X-Mailer: XFMail 1.5.3 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20021125221003.A19207@sylvester.dsj.net> Date: Mon, 25 Nov 2002 23:57:35 -0600 (CST) Reply-To: conrads@cox.net Organization: A Rag-Tag Band of Drug-crazed Hippies From: Conrad Sabatier To: "David S. Jackson" Subject: Re: xargs -J Cc: freebsd-questions@FreeBSD.ORG 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 26-Nov-2002 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? I think what you want here is -I instead of -J. -I allows for multiple replacements, whereas -J does not. Also, I'd suggest using something other than [] as your placeholder, as those characters have a special meaning in the shell. Using something simple, like %, as the man page illustrates. -- Conrad Sabatier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message