From owner-freebsd-questions Thu May 18 11:20: 5 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id D036237B65E for ; Thu, 18 May 2000 11:19:58 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e4IIqnN26445; Thu, 18 May 2000 11:52:49 -0700 (PDT) Date: Thu, 18 May 2000 11:52:49 -0700 From: Alfred Perlstein To: Ataualpa Albert Carmo Braga Cc: questions@FreeBSD.ORG Subject: Re: renaming files Message-ID: <20000518115249.B21508@fw.wintelcom.net> References: <20000518180041.385F118C9@bico-de-lacre.iqm.unicamp.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000518180041.385F118C9@bico-de-lacre.iqm.unicamp.br>; from atabraga@bico-de-lacre.iqm.unicamp.br on Thu, May 18, 2000 at 03:00:41PM -0300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Ataualpa Albert Carmo Braga [000518 11:34] wrote: > Try anything like this: > > #!/usr/bin/perl > > @change='ls *.orig'; > foreach $orig (@change){ > chop($orig); > $new=$orig; > $new =~ s/orig/new/g; > rename ($orig,$new); > } Well, I'm not sure what the point of this post is, but: for i in *.orig ; do echo $i $i ; done | sed 's/orig$/new/' | xargs -n 2 mv works in borne. :) -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message