Date: Thu, 18 May 2000 11:52:49 -0700 From: Alfred Perlstein <bright@wintelcom.net> To: Ataualpa Albert Carmo Braga <atabraga@bico-de-lacre.iqm.unicamp.br> Cc: questions@FreeBSD.ORG Subject: Re: renaming files Message-ID: <20000518115249.B21508@fw.wintelcom.net> 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 References: <20000518180041.385F118C9@bico-de-lacre.iqm.unicamp.br>
index | next in thread | previous in thread | raw e-mail
* Ataualpa Albert Carmo Braga <atabraga@bico-de-lacre.iqm.unicamp.br> [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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000518115249.B21508>
