quickie

Christopher Twigg cdtwigg at u.washington.edu
Mon May 22 19:44:07 PDT 2000


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