From owner-freebsd-questions Mon Nov 25 19:27: 1 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 0C52D37B401 for ; Mon, 25 Nov 2002 19:27:00 -0800 (PST) Received: from mail.au.darkbluesea.com (mail.au.darkbluesea.com [203.185.208.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F51143EAF for ; Mon, 25 Nov 2002 19:26:57 -0800 (PST) (envelope-from d.anker@au.darkbluesea.com) Received: (qmail 74781 invoked by uid 82); 26 Nov 2002 03:24:37 -0000 Received: from unknown (HELO ?10.0.0.188?) (10.0.0.188) by mail.au.darkbluesea.com with SMTP; 26 Nov 2002 03:24:37 -0000 Subject: Re: xargs -J From: Duncan Anker To: "David S. Jackson" Cc: freebsd-questions@freebsd.org In-Reply-To: <20021125221003.A19207@sylvester.dsj.net> References: <20021125221003.A19207@sylvester.dsj.net> Content-Type: text/plain Organization: Dark Blue Sea Message-Id: <1038281207.1512.41.camel@duncan.au.darkbluesea.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 26 Nov 2002 13:26:47 +1000 Content-Transfer-Encoding: 7bit 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 Tue, 2002-11-26 at 13:10, 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've never tried to do it this way, but I suspect that you can only use your delimiter once. In any case, if what you are wanting to do is rename a bunch of files, try something like: # for file in one two three; do mv $file `echo $file | sed -e 's/$/.suffix/'`; done That's the way I've always done it - works a treat (try doing THAT with a GUI :-) Hope it helps, unless you had your heart set on xargs Regards, Duncan Anker Senior Systems Administrator Dark Blue Sea -- The information contained in this email is confidential. If you are not the intended recipient, you may not disclose or use the information in this email in any way. Dark Blue Sea does not guarantee the integrity of any emails or attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Dark Blue Sea. Dark Blue Sea does not warrant that any attachments are free from viruses or other defects. You assume all liability for any loss, damage or other consequences which may arise from opening or using the attachments. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message