Cui wrote:

> 
> Subject: How to change the Upercase file name to lowercase
> Date: Fri, 26 Jun 1998 00:39:36 +0800
> From: "Cui Jian" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 
> I just migrate my web file form Windows NT to Linux, in NT,the file name is 
>uppercase, now I need lowercase file name. How to do this. I know the "tr" command 
>can to this, but I don't familiar with linux command. and body can help me ? Thanks a 
>lot.
> 
> Cui Jian
> China OnLine
> Fax: 86-29-5219746
> Tel: 86-29-5219748
> Pager: 86-29-8405566-19189
> Email: [EMAIL PROTECTED]
> 

I haven't read my mail in a couple of days, so I'm sure you've already
gotten some responses, but here's a little perl script I use:

--------------------------------------------------------------------

#!/usr/local/bin/perl
print "We're Off !!!\n";
$count=0;
while ( $count < @ARGV )
{
     $INPUT_STRING = $ARGV[$count];
     print "$INPUT_STRING\t renamed to : ";
     $NEWSTRING= "\U$INPUT_STRING\E";
     print "$NEWSTRING\n\n";
     rename($INPUT_STRING, $NEWSTRING);
     $count++;
}

--------------------------------------------------------------------

Call it whatever you want, and run it as:

        whatever <filename>

Wildcards work, so

        whatever ./*

will convert everything in the current directory.  Hope it helps.

Mike


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to