Mixed Case Directory Names

Luke Davis ldavis at shellworld.net
Tue Nov 11 20:48:51 EST 2003


When I run it here, it gives me an error if I don't specify a directory on
the command line.  If I give it a valid one, it works perfectly.

If you put it in a file called "renamer", then do:

chmod 700 renamer

Then do:

./renamer /my/path/containing/directories/to/rename

nothing happens?

I do see one thing that needs to change: replace the first line with:

#!/bin/bash

Luke


On Tue, 11 Nov 2003, Rejean Proulx wrote:

> It still doesn't work. I put that if error handling stuff at the beginning
> and it just finishes without errors.  It doesn't give me an error if I don't
> put in a directory name.
>
>  Rejean Proulx
> Visit my family at http://interfree.ca
> MSN is: rejp at rogers.com
> Ham License VA3REJ
>
> ----- Original Message -----
> From: "Luke Davis" <ldavis at shellworld.net>
> To: <Speakup at braille.uwo.ca>
> Sent: Tuesday, November 11, 2003 12:57 AM
> Subject: Re: Mixed Case Directory Names
>
>
> > This is untested, but Try this:
> >
> > #!/bin/sh
> > if [ -z $1 ]; then
> > echo "You didn't specify a directory!";
> > exit 1;
> > elif [ -d $1 ]; then
> > tf=/tmp/renamer.$$;
> > rm -f $tf;
> > ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
> > source $tf;
> > exit 0;
> > else echo "$1 is not a directory!";
> > exit 2;
> > fi
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup at braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>




More information about the Speakup mailing list