Solved

Cpoying files UPPERCASE

Posted on 2000-04-19
6
215 Views
Last Modified: 2010-04-21
How can I copy files if I want their names to be always in Uppercase?
0
Comment
Question by:rolli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 21

Expert Comment

by:tfewster
ID: 2732087
If you mean you want to rename files so the names are all upper case:

#/bin/sh
#upper.sh
#Usage upper.sh filename
mv $1 `echo $1 |tr [:lower:] [:upper:]`



0
 
LVL 21

Expert Comment

by:tfewster
ID: 2763485
As you haven't given us any feedback I'll assume my comment gave you what you needed :)
0
 

Author Comment

by:rolli
ID: 2770433
It would be an excellent answer, but I need the files inside the folders to be 'uppercased' as well, so keep trying!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:tfewster
ID: 2770741
OK, using that script:

cd directory_containing_files_to_be renamed
find . -depth -exec /path/to/upper.sh {} \;

This will rename everything below the start point for the find - directories, subdirectories & files, but the "find" won't follow links.

Is this a one-off task, or would it be better to consider how to give the files "good" names when they are created? Please expand...
0
 
LVL 84

Expert Comment

by:ozo
ID: 2771211
perl -MFile::Find -e 'find(sub{rename $_,uc $_ or warn "$_:$!" if /[a-z]/ },".")'
0
 
LVL 21

Accepted Solution

by:
tfewster earned 50 total points
ID: 2818228
I guess you've done the job by now, so would you like to accept one of the comments (from whoever supplied the method you used) as an answer?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question