Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Upper case file and directory names
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
abhishek
Retired Dev
Retired Dev


Joined: 28 Jun 2002
Posts: 393
Location: Los Angeles, CA

PostPosted: Wed Jul 17, 2002 4:27 am    Post subject: Upper case file and directory names Reply with quote

I downloaded an ebook, and all the links have lowecase file and directory names, and the actual file and directory names are uppercase. I want to know a short way of changing all the names. Don't konw any scripting.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Jul 17, 2002 4:32 am    Post subject: Re: Upper case file and directory names Reply with quote

data_the_android wrote:
I downloaded an ebook, and all the links have lowecase file and directory names, and the actual file and directory names are uppercase. I want to know a short way of changing all the names. Don't konw any scripting.

Code:
perl -e 'while( $_ = shift ) { rename( $_, lc( $_ ) }' *

It won't descend subdirectories, but that should give you a start. Replace 'lc' with 'uc' if you want uppercase instead of lowercase.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
abhishek
Retired Dev
Retired Dev


Joined: 28 Jun 2002
Posts: 393
Location: Los Angeles, CA

PostPosted: Wed Jul 17, 2002 4:36 am    Post subject: Reply with quote

This is what i get when i run it:
Code:
perl -e 'while( $_ = shift ) { rename( $_, lc( $_ ) }' *
syntax error at -e line 1, near ") }"
Execution of -e aborted due to compilation errors.
[/code]
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Jul 17, 2002 4:38 am    Post subject: Reply with quote

data_the_android wrote:
This is what i get when i run it:
Code:
perl -e 'while( $_ = shift ) { rename( $_, lc( $_ ) }' *
syntax error at -e line 1, near ") }"
Execution of -e aborted due to compilation errors.
[/code]

Whoops...missing a close parenthesis in there, sorry:
Code:
perl -e 'while( $_ = shift ) { rename( $_, lc( $_ ) ); }' *

_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
abhishek
Retired Dev
Retired Dev


Joined: 28 Jun 2002
Posts: 393
Location: Los Angeles, CA

PostPosted: Wed Jul 17, 2002 4:39 am    Post subject: Reply with quote

That works. Thanks :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum