quickie

R. David Whitlock ryandav at u.washington.edu
Mon May 22 19:48:31 PDT 2000


Yeah, thats actually almost exactly what I did, but I was trying to do it
in a single command line. I kept trying to use pipes with wildcards, but
no dice. I bet there's a shell variable for "last match" that I just
can't think of that would work as thus:

mv * ./$VAR.bak

or something to that effect...

Later,
David



On Mon, 22 May 2000, Christopher Twigg wrote:


> Here's how I've always done that:

>

> Script:

> ----

> #!/usr/bin/perl

>

> foreach $arg ( @ARGV )

> {

> rename $arg, "$arg.png";

> }

> ----

>

> Command line:

> bash$ ./rename.pl *

>

> ---

>

> Christopher Twigg

> cdtwigg at u.washington.edu

>

> On Mon, 22 May 2000, R. David Whitlock wrote:

>

> > ok, here's a quickie:

> >

> > how would you rename all files in a directory to the same name plus an

> > extension on the command line?

> >

> > for example, if I have 12 files named "1" "2" "3", etc, how to turn them

> > all into "1.png" "2.png" "3.png", etc?

> >

> > -david

> >

> >

> >

> >

>

>




More information about the Linux mailing list