| View previous topic :: View next topic |
| Author |
Message |
abhishek Retired Dev


Joined: 28 Jun 2002 Posts: 393 Location: Los Angeles, CA
|
Posted: Wed Jul 17, 2002 4:27 am Post subject: Upper case file and directory names |
|
|
| 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 |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Jul 17, 2002 4:32 am Post subject: Re: Upper case file and directory names |
|
|
| 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 |
|
 |
abhishek Retired Dev


Joined: 28 Jun 2002 Posts: 393 Location: Los Angeles, CA
|
Posted: Wed Jul 17, 2002 4:36 am Post subject: |
|
|
This is what i get when i run it: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 |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Jul 17, 2002 4:38 am Post subject: |
|
|
| data_the_android wrote: | This is what i get when i run it: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 |
|
 |
abhishek Retired Dev


Joined: 28 Jun 2002 Posts: 393 Location: Los Angeles, CA
|
Posted: Wed Jul 17, 2002 4:39 am Post subject: |
|
|
That works. Thanks  |
|
| Back to top |
|
 |
|