* Mixed Case Directory Names
@ Rejean Proulx
` Luke Davis
` Thomas Stivers
0 siblings, 2 replies; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: speakup
Is there a way of changing a bunch of directories from mixed case to lower
case names?
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Mixed Case Directory Names
Mixed Case Directory Names Rejean Proulx
@ ` Luke Davis
` Rejean Proulx
` Rejean Proulx
` Thomas Stivers
1 sibling, 2 replies; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Do you want a script to do them all at once, or can you do it manually?
If manyally, just do:
mv DiReCtoRY directory
On Mon, 10 Nov 2003, Rejean Proulx wrote:
> Is there a way of changing a bunch of directories from mixed case to lower
> case names?
>
> Rejean Proulx
> Visit my family at http://interfree.ca
> MSN is: rejp@rogers.com
> Ham License VA3REJ
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Luke Davis
@ ` Rejean Proulx
` Luke Davis
` Rejean Proulx
1 sibling, 1 reply; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
We need a script in the worst way. We have 7,000 of them to do.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Monday, November 10, 2003 7:30 PM
Subject: Re: Mixed Case Directory Names
> Do you want a script to do them all at once, or can you do it manually?
>
> If manyally, just do:
>
> mv DiReCtoRY directory
>
> On Mon, 10 Nov 2003, Rejean Proulx wrote:
>
> > Is there a way of changing a bunch of directories from mixed case to
lower
> > case names?
> >
> > Rejean Proulx
> > Visit my family at http://interfree.ca
> > MSN is: rejp@rogers.com
> > Ham License VA3REJ
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Rejean Proulx
@ ` Luke Davis
` Rejean Proulx
` Rejean Proulx
0 siblings, 2 replies; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
This should do it for you. Call it with the root directory of the
directories/files whos' names you want to change.
For example, if you called it "renamer", and your files were in
"/var/www/files/otherfiles", you would do:
./renamer /var/www/files/otherfiles
The script follows:
#!/bin/sh
cd $1 || echo "No such directory." && exit 1;
tf=/tmp/renamer.$$;
rm -f $tf;
ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
source $tf;
rm -f $tf;
exit 0;
On Mon, 10 Nov 2003, Rejean Proulx wrote:
> We need a script in the worst way. We have 7,000 of them to do.
>
> Rejean Proulx
> Visit my family at http://interfree.ca
> MSN is: rejp@rogers.com
> Ham License VA3REJ
>
> ----- Original Message -----
> From: "Luke Davis" <ldavis@shellworld.net>
> To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
> Sent: Monday, November 10, 2003 7:30 PM
> Subject: Re: Mixed Case Directory Names
>
>
> > Do you want a script to do them all at once, or can you do it manually?
> >
> > If manyally, just do:
> >
> > mv DiReCtoRY directory
> >
> > On Mon, 10 Nov 2003, Rejean Proulx wrote:
> >
> > > Is there a way of changing a bunch of directories from mixed case to
> lower
> > > case names?
> > >
> > > Rejean Proulx
> > > Visit my family at http://interfree.ca
> > > MSN is: rejp@rogers.com
> > > Ham License VA3REJ
> > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Luke Davis
@ ` Rejean Proulx
` Rejean Proulx
1 sibling, 0 replies; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Thanks, I trust you, but I'm making a copy of this stuff and then I'll run
it. Seriously, I wouldn't mind asking you questions about this script. I
know that you are storing an ls of the files. but I'm not quite sure how
the rest of the thing works.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Monday, November 10, 2003 9:43 PM
Subject: Re: Mixed Case Directory Names
> This should do it for you. Call it with the root directory of the
> directories/files whos' names you want to change.
>
> For example, if you called it "renamer", and your files were in
> "/var/www/files/otherfiles", you would do:
>
> ./renamer /var/www/files/otherfiles
>
> The script follows:
>
> #!/bin/sh
> cd $1 || echo "No such directory." && exit 1;
> tf=/tmp/renamer.$$;
> rm -f $tf;
> ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
> source $tf;
> rm -f $tf;
> exit 0;
>
>
>
>
>
>
>
>
>
>
> On Mon, 10 Nov 2003, Rejean Proulx wrote:
>
> > We need a script in the worst way. We have 7,000 of them to do.
> >
> > Rejean Proulx
> > Visit my family at http://interfree.ca
> > MSN is: rejp@rogers.com
> > Ham License VA3REJ
> >
> > ----- Original Message -----
> > From: "Luke Davis" <ldavis@shellworld.net>
> > To: "Speakup is a screen review system for Linux."
<speakup@braille.uwo.ca>
> > Sent: Monday, November 10, 2003 7:30 PM
> > Subject: Re: Mixed Case Directory Names
> >
> >
> > > Do you want a script to do them all at once, or can you do it
manually?
> > >
> > > If manyally, just do:
> > >
> > > mv DiReCtoRY directory
> > >
> > > On Mon, 10 Nov 2003, Rejean Proulx wrote:
> > >
> > > > Is there a way of changing a bunch of directories from mixed case to
> > lower
> > > > case names?
> > > >
> > > > Rejean Proulx
> > > > Visit my family at http://interfree.ca
> > > > MSN is: rejp@rogers.com
> > > > Ham License VA3REJ
> > > >
> > > >
> > > > _______________________________________________
> > > > Speakup mailing list
> > > > Speakup@braille.uwo.ca
> > > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Luke Davis
` Rejean Proulx
@ ` Rejean Proulx
` Luke Davis
1 sibling, 1 reply; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
I know now, you remove the temp file, create a file with the commands and
run it. I had to figure this out, but it is tougher when you don't know the
language. There is obviously a tolower function. I will try to run this
tonight if I can get the stuff copied to my windows machine as a backup in
time.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Monday, November 10, 2003 9:43 PM
Subject: Re: Mixed Case Directory Names
> This should do it for you. Call it with the root directory of the
> directories/files whos' names you want to change.
>
> For example, if you called it "renamer", and your files were in
> "/var/www/files/otherfiles", you would do:
>
> ./renamer /var/www/files/otherfiles
>
> The script follows:
>
> #!/bin/sh
> cd $1 || echo "No such directory." && exit 1;
> tf=/tmp/renamer.$$;
> rm -f $tf;
> ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
> source $tf;
> rm -f $tf;
> exit 0;
>
>
>
>
>
>
>
>
>
>
> On Mon, 10 Nov 2003, Rejean Proulx wrote:
>
> > We need a script in the worst way. We have 7,000 of them to do.
> >
> > Rejean Proulx
> > Visit my family at http://interfree.ca
> > MSN is: rejp@rogers.com
> > Ham License VA3REJ
> >
> > ----- Original Message -----
> > From: "Luke Davis" <ldavis@shellworld.net>
> > To: "Speakup is a screen review system for Linux."
<speakup@braille.uwo.ca>
> > Sent: Monday, November 10, 2003 7:30 PM
> > Subject: Re: Mixed Case Directory Names
> >
> >
> > > Do you want a script to do them all at once, or can you do it
manually?
> > >
> > > If manyally, just do:
> > >
> > > mv DiReCtoRY directory
> > >
> > > On Mon, 10 Nov 2003, Rejean Proulx wrote:
> > >
> > > > Is there a way of changing a bunch of directories from mixed case to
> > lower
> > > > case names?
> > > >
> > > > Rejean Proulx
> > > > Visit my family at http://interfree.ca
> > > > MSN is: rejp@rogers.com
> > > > Ham License VA3REJ
> > > >
> > > >
> > > > _______________________________________________
> > > > Speakup mailing list
> > > > Speakup@braille.uwo.ca
> > > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Rejean Proulx
@ ` Luke Davis
0 siblings, 0 replies; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup
"tolower()", is an awk, not a bash, function.
On Mon, 10 Nov 2003, Rejean Proulx wrote:
> I know now, you remove the temp file, create a file with the commands and
> run it. I had to figure this out, but it is tougher when you don't know the
> language. There is obviously a tolower function. I will try to run this
> tonight if I can get the stuff copied to my windows machine as a backup in
> time.
>
> Rejean Proulx
> Visit my family at http://interfree.ca
> MSN is: rejp@rogers.com
> Ham License VA3REJ
>
> ----- Original Message -----
> From: "Luke Davis" <ldavis@shellworld.net>
> To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
> Sent: Monday, November 10, 2003 9:43 PM
> Subject: Re: Mixed Case Directory Names
>
>
> > This should do it for you. Call it with the root directory of the
> > directories/files whos' names you want to change.
> >
> > For example, if you called it "renamer", and your files were in
> > "/var/www/files/otherfiles", you would do:
> >
> > ./renamer /var/www/files/otherfiles
> >
> > The script follows:
> >
> > #!/bin/sh
> > cd $1 || echo "No such directory." && exit 1;
> > tf=/tmp/renamer.$$;
> > rm -f $tf;
> > ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
> > source $tf;
> > rm -f $tf;
> > exit 0;
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, 10 Nov 2003, Rejean Proulx wrote:
> >
> > > We need a script in the worst way. We have 7,000 of them to do.
> > >
> > > Rejean Proulx
> > > Visit my family at http://interfree.ca
> > > MSN is: rejp@rogers.com
> > > Ham License VA3REJ
> > >
> > > ----- Original Message -----
> > > From: "Luke Davis" <ldavis@shellworld.net>
> > > To: "Speakup is a screen review system for Linux."
> <speakup@braille.uwo.ca>
> > > Sent: Monday, November 10, 2003 7:30 PM
> > > Subject: Re: Mixed Case Directory Names
> > >
> > >
> > > > Do you want a script to do them all at once, or can you do it
> manually?
> > > >
> > > > If manyally, just do:
> > > >
> > > > mv DiReCtoRY directory
> > > >
> > > > On Mon, 10 Nov 2003, Rejean Proulx wrote:
> > > >
> > > > > Is there a way of changing a bunch of directories from mixed case to
> > > lower
> > > > > case names?
> > > > >
> > > > > Rejean Proulx
> > > > > Visit my family at http://interfree.ca
> > > > > MSN is: rejp@rogers.com
> > > > > Ham License VA3REJ
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Speakup mailing list
> > > > > Speakup@braille.uwo.ca
> > > > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > > > >
> > > >
> > > > _______________________________________________
> > > > Speakup mailing list
> > > > Speakup@braille.uwo.ca
> > > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Mixed Case Directory Names
` Luke Davis
` Rejean Proulx
@ ` Rejean Proulx
` Barry Pollock
1 sibling, 1 reply; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
if it works well, I will schedule it weekly or something. It is turning our
library in to a disaster. Everything is out of order.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Monday, November 10, 2003 7:30 PM
Subject: Re: Mixed Case Directory Names
> Do you want a script to do them all at once, or can you do it manually?
>
> If manyally, just do:
>
> mv DiReCtoRY directory
>
> On Mon, 10 Nov 2003, Rejean Proulx wrote:
>
> > Is there a way of changing a bunch of directories from mixed case to
lower
> > case names?
> >
> > Rejean Proulx
> > Visit my family at http://interfree.ca
> > MSN is: rejp@rogers.com
> > Ham License VA3REJ
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Rejean Proulx
@ ` Barry Pollock
` Rejean Proulx
` Luke Davis
0 siblings, 2 replies; 22+ messages in thread
From: Barry Pollock @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
It looks that the script that Luke sent deletes the directory. If I
understand it correctly, All you want to do is rename the directory.
Do you have to rename the files in that directory?
Barry
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Barry Pollock
@ ` Rejean Proulx
` Luke Davis
1 sibling, 0 replies; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
No we don't have too. we have other ways of renaming them. If it renames
them and they had mixed case its ok.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Barry Pollock" <barryp@mail.hurontel.on.ca>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Tuesday, November 11, 2003 9:22 AM
Subject: Re: Mixed Case Directory Names
> It looks that the script that Luke sent deletes the directory. If I
> understand it correctly, All you want to do is rename the directory.
> Do you have to rename the files in that directory?
> Barry
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Barry Pollock
` Rejean Proulx
@ ` Luke Davis
` Rejean Proulx
1 sibling, 1 reply; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
My script deletes the directory? Oh hell. I need to go find the sent
mail on this, and reread the script. That's what I get for not testing.
Rejean, my most sinseer apologies.
Luke
On Tue, 11 Nov 2003, Barry Pollock wrote:
> It looks that the script that Luke sent deletes the directory. If I
> understand it correctly, All you want to do is rename the directory.
> Do you have to rename the files in that directory?
> Barry
>
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Luke Davis
@ ` Rejean Proulx
0 siblings, 0 replies; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
it didn't delete a directory on my machine. I couldn't get it to even
accept one. I will add the error front end you sent and try it. I have
just a small directory as a test so if it ever deletes it, it doesn't
matter. It doesn't look like it should delete it. It looks like an rm to a
temp directory to me.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Tuesday, November 11, 2003 3:00 PM
Subject: Re: Mixed Case Directory Names
> My script deletes the directory? Oh hell. I need to go find the sent
> mail on this, and reread the script. That's what I get for not testing.
>
> Rejean, my most sinseer apologies.
>
> Luke
>
> On Tue, 11 Nov 2003, Barry Pollock wrote:
>
> > It looks that the script that Luke sent deletes the directory. If I
> > understand it correctly, All you want to do is rename the directory.
> > Do you have to rename the files in that directory?
> > Barry
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Mixed Case Directory Names
Mixed Case Directory Names Rejean Proulx
` Luke Davis
@ ` Thomas Stivers
` Rejean Proulx
1 sibling, 1 reply; 22+ messages in thread
From: Thomas Stivers @ UTC (permalink / raw)
To: speakup
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/10/03 7:05 PM -0500, Rejean Proulx wrote:
> Is there a way of changing a bunch of directories from mixed case to lower
> case names?
On my debian system I have the rename program, but I remember if it was
in its own package or not. I think it will do what you want fairly
easily. You can try the following.
rename 'tr/A-Z/a-z/' *
That renames everything in a directory, but not recursively. I have
found rename to ve invaluable when dealing with lots of files which need
to conform to a naming convension. Good luck.
- --
Unix is a user friendly operating system. It just picks its friends more
carefully than others.
Thomas Stivers e-mail: stivers_t@tomass.dyndns.org gpg: 45CBBABD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/sP5Z5JK61UXLur0RAgVfAJ9j8unxuA1Zim+BywJSgmTpH+O0AgCfdvQb
w4C7BHNo/JVG1iWqHtpccRQ=
=H5dY
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Thomas Stivers
@ ` Rejean Proulx
` Barry Pollock
0 siblings, 1 reply; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
Can it do recursive renames? I need that as I have 7000 directories.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Thomas Stivers" <stivers_t@tomass.dyndns.org>
To: <speakup@braille.uwo.ca>
Sent: Tuesday, November 11, 2003 10:20 AM
Subject: Re: Mixed Case Directory Names
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 11/10/03 7:05 PM -0500, Rejean Proulx wrote:
> > Is there a way of changing a bunch of directories from mixed case to
lower
> > case names?
>
> On my debian system I have the rename program, but I remember if it was
> in its own package or not. I think it will do what you want fairly
> easily. You can try the following.
>
> rename 'tr/A-Z/a-z/' *
>
> That renames everything in a directory, but not recursively. I have
> found rename to ve invaluable when dealing with lots of files which need
> to conform to a naming convension. Good luck.
>
> - --
> Unix is a user friendly operating system. It just picks its friends more
> carefully than others.
> Thomas Stivers e-mail: stivers_t@tomass.dyndns.org gpg: 45CBBABD
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
>
> iD8DBQE/sP5Z5JK61UXLur0RAgVfAJ9j8unxuA1Zim+BywJSgmTpH+O0AgCfdvQb
> w4C7BHNo/JVG1iWqHtpccRQ=
> =H5dY
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Rejean Proulx
@ ` Barry Pollock
` Rejean Proulx
0 siblings, 1 reply; 22+ messages in thread
From: Barry Pollock @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
rename is just a perl script that does not work recursively. I have some
recursive perl code in some of my directory scripts I could write you
one
that would do the job.
If you are doing it, you want unwanted characters such as `(
' or `&' removed or changed first? Spaces converted to `_' or what.
If were doing it, we mayas well make it fully functional.
Barry
On Tue, 11 Nov 2003, Rejean Proulx wrote:
> Can it do recursive renames? I need that as I have 7000 directories.
>
> Rejean Proulx
> Visit my family at http://interfree.ca
> MSN is: rejp@rogers.com
> Ham License VA3REJ
>
> ----- Original Message -----
> From: "Thomas Stivers" <stivers_t@tomass.dyndns.org>
> To: <speakup@braille.uwo.ca>
> Sent: Tuesday, November 11, 2003 10:20 AM
> Subject: Re: Mixed Case Directory Names
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On 11/10/03 7:05 PM -0500, Rejean Proulx wrote:
> > > Is there a way of changing a bunch of directories from mixed case to
> lower
> > > case names?
> >
> > On my debian system I have the rename program, but I remember if it was
> > in its own package or not. I think it will do what you want fairly
> > easily. You can try the following.
> >
> > rename 'tr/A-Z/a-z/' *
> >
> > That renames everything in a directory, but not recursively. I have
> > found rename to ve invaluable when dealing with lots of files which need
> > to conform to a naming convension. Good luck.
> >
> > - --
> > Unix is a user friendly operating system. It just picks its friends more
> > carefully than others.
> > Thomas Stivers e-mail: stivers_t@tomass.dyndns.org gpg: 45CBBABD
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.3 (GNU/Linux)
> >
> > iD8DBQE/sP5Z5JK61UXLur0RAgVfAJ9j8unxuA1Zim+BywJSgmTpH+O0AgCfdvQb
> > w4C7BHNo/JVG1iWqHtpccRQ=
> > =H5dY
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Barry Pollock
@ ` Rejean Proulx
0 siblings, 0 replies; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
I don't want anything touched except change all letters from upper to lower.
Leave all other characters alone. You can do all directories and files.
Hopefully, it would only rename something if it has uppercase in it as I
might have to set this up in a cron and run daily. I thought of trying it
myself as I am an experienced programmer but I don't know perl or Shell
script. This is too important a job for a Newby.
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Barry Pollock" <barryp@mail.hurontel.on.ca>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Tuesday, November 11, 2003 4:17 PM
Subject: Re: Mixed Case Directory Names
> rename is just a perl script that does not work recursively. I have some
> recursive perl code in some of my directory scripts I could write you
> one
> that would do the job.
> If you are doing it, you want unwanted characters such as `(
> ' or `&' removed or changed first? Spaces converted to `_' or what.
> If were doing it, we mayas well make it fully functional.
> Barry
>
>
> On Tue, 11 Nov 2003, Rejean Proulx wrote:
>
> > Can it do recursive renames? I need that as I have 7000 directories.
> >
> > Rejean Proulx
> > Visit my family at http://interfree.ca
> > MSN is: rejp@rogers.com
> > Ham License VA3REJ
> >
> > ----- Original Message -----
> > From: "Thomas Stivers" <stivers_t@tomass.dyndns.org>
> > To: <speakup@braille.uwo.ca>
> > Sent: Tuesday, November 11, 2003 10:20 AM
> > Subject: Re: Mixed Case Directory Names
> >
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > On 11/10/03 7:05 PM -0500, Rejean Proulx wrote:
> > > > Is there a way of changing a bunch of directories from mixed case to
> > lower
> > > > case names?
> > >
> > > On my debian system I have the rename program, but I remember if it
was
> > > in its own package or not. I think it will do what you want fairly
> > > easily. You can try the following.
> > >
> > > rename 'tr/A-Z/a-z/' *
> > >
> > > That renames everything in a directory, but not recursively. I have
> > > found rename to ve invaluable when dealing with lots of files which
need
> > > to conform to a naming convension. Good luck.
> > >
> > > - --
> > > Unix is a user friendly operating system. It just picks its friends
more
> > > carefully than others.
> > > Thomas Stivers e-mail: stivers_t@tomass.dyndns.org gpg: 45CBBABD
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.2.3 (GNU/Linux)
> > >
> > > iD8DBQE/sP5Z5JK61UXLur0RAgVfAJ9j8unxuA1Zim+BywJSgmTpH+O0AgCfdvQb
> > > w4C7BHNo/JVG1iWqHtpccRQ=
> > > =H5dY
> > > -----END PGP SIGNATURE-----
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Mixed Case Directory Names
@ Luke Davis
` Rejean Proulx
0 siblings, 1 reply; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup
One of the first things the script does, is to place the name of a file in
the "tf" variable.
That file name is "/tmp/renamer.", followed by the current unique process
ID (a number from 1 to five digits).
ls *[A-Z]*
Is a standard ls, with the file spec provided as a (bastardized
(bashtardized?)) regular expression. That regexp says:
*: zero or more characters of any kind
[: start a character class specification
A-Z: class specification: any characters inclusively between capital A and
capital Z (that is: the entire capitalized alphabet)
]: Close the class spec
*: any character
So, ls will only list files that have at least one capital letter in their
names. Otherwise, there would have had to been some error handling which
I did not care to deal with.
Now, we send the output of that ls, via the pipe character (send to
another program) ("|"), into the awk program, which is a text processor.
That program takes each line of input (a single file name--ls outputs
files one per line when sending to programs), and does the following with
it:
1. Outputs the letters "mv".
2. Outputs a space.
3. Outputs the first field of the line (the file name).
4. Outputs a space.
5A. Runs the "tolower" function, giving it that same first field as the
string to convert to lower case.
5B. Outputs the result of that function, which is a lower case file name.
It does that for each line, and sends the output to the file named in the
variable "tf" (see the top of the script).
It then sources that same file from $tf. By sourcing, I mean that it
reads in the contents of that file, and executes them as if they were
originally part of the program.
There is also some business about deleting $tf if it already exists, and
at the end of the program, changing to the initial directory (and
generating an error if that doesn't work), and so on.
If you want to see what the sourced file looks like, remove the last "rm"
statement, then read a file in /tmp, called "renamer.<some numbers>".
HTH
Luke
On Mon, 10 Nov 2003, Rejean Proulx wrote:
> Thanks, I trust you, but I'm making a copy of this stuff and then I'll run
> it. Seriously, I wouldn't mind asking you questions about this script. I
> know that you are storing an ls of the files. but I'm not quite sure how
> the rest of the thing works.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
Luke Davis
@ ` Rejean Proulx
0 siblings, 0 replies; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
i tried it and it didn't change directories. In fact, it did nothing. It
is as if it doesn't read the $1 as a variable. I commented out the last rm
to make sure it didn't do anything and in fact there is not renamer$$ in
/var/tmp
The script must be ok because there is no error. It just does nothing. if
I just enter renamer.sh with no parameters it does nothing. I thoght it
should say invalid directory or something.
#!/bin/sh
cd $1 || echo "No such directory." && exit 1;
tf=/tmp/renamer.$$;
rm -f $tf;
ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
source $tf;
rm -f $tf;
exit 0;
Rejean Proulx
Visit my family at http://interfree.ca
MSN is: rejp@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: <Speakup@braille.uwo.ca>
Sent: Monday, November 10, 2003 10:27 PM
Subject: Re: Mixed Case Directory Names
> One of the first things the script does, is to place the name of a file in
> the "tf" variable.
> That file name is "/tmp/renamer.", followed by the current unique process
> ID (a number from 1 to five digits).
>
> ls *[A-Z]*
>
> Is a standard ls, with the file spec provided as a (bastardized
> (bashtardized?)) regular expression. That regexp says:
>
> *: zero or more characters of any kind
> [: start a character class specification
> A-Z: class specification: any characters inclusively between capital A and
> capital Z (that is: the entire capitalized alphabet)
> ]: Close the class spec
> *: any character
>
> So, ls will only list files that have at least one capital letter in their
> names. Otherwise, there would have had to been some error handling which
> I did not care to deal with.
>
> Now, we send the output of that ls, via the pipe character (send to
> another program) ("|"), into the awk program, which is a text processor.
> That program takes each line of input (a single file name--ls outputs
> files one per line when sending to programs), and does the following with
> it:
>
> 1. Outputs the letters "mv".
> 2. Outputs a space.
> 3. Outputs the first field of the line (the file name).
> 4. Outputs a space.
> 5A. Runs the "tolower" function, giving it that same first field as the
> string to convert to lower case.
> 5B. Outputs the result of that function, which is a lower case file name.
>
> It does that for each line, and sends the output to the file named in the
> variable "tf" (see the top of the script).
> It then sources that same file from $tf. By sourcing, I mean that it
> reads in the contents of that file, and executes them as if they were
> originally part of the program.
>
> There is also some business about deleting $tf if it already exists, and
> at the end of the program, changing to the initial directory (and
> generating an error if that doesn't work), and so on.
>
> If you want to see what the sourced file looks like, remove the last "rm"
> statement, then read a file in /tmp, called "renamer.<some numbers>".
>
> HTH
>
> Luke
>
>
>
>
>
>
> On Mon, 10 Nov 2003, Rejean Proulx wrote:
>
> > Thanks, I trust you, but I'm making a copy of this stuff and then I'll
run
> > it. Seriously, I wouldn't mind asking you questions about this script.
I
> > know that you are storing an ls of the files. but I'm not quite sure
how
> > the rest of the thing works.
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Mixed Case Directory Names
@ Luke Davis
` Rejean Proulx
0 siblings, 1 reply; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup
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
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
Luke Davis
@ ` Rejean Proulx
` Luke Davis
0 siblings, 1 reply; 22+ messages in thread
From: Rejean Proulx @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
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@rogers.com
Ham License VA3REJ
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: <Speakup@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@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: Mixed Case Directory Names
` Rejean Proulx
@ ` Luke Davis
0 siblings, 0 replies; 22+ messages in thread
From: Luke Davis @ UTC (permalink / raw)
To: Speakup is a screen review system for Linux.
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@rogers.com
> Ham License VA3REJ
>
> ----- Original Message -----
> From: "Luke Davis" <ldavis@shellworld.net>
> To: <Speakup@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@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <001f01c3a897$bfefaeb0$6901a8c0@ism.can.ibm.com>]
end of thread, other threads:[~ UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
Mixed Case Directory Names Rejean Proulx
` Luke Davis
` Rejean Proulx
` Luke Davis
` Rejean Proulx
` Rejean Proulx
` Luke Davis
` Rejean Proulx
` Barry Pollock
` Rejean Proulx
` Luke Davis
` Rejean Proulx
` Thomas Stivers
` Rejean Proulx
` Barry Pollock
` Rejean Proulx
Luke Davis
` Rejean Proulx
Luke Davis
` Rejean Proulx
` Luke Davis
[not found] <001f01c3a897$bfefaeb0$6901a8c0@ism.can.ibm.com>
` Luke Davis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).