Solved

Cpoying files UPPERCASE

Posted on 2000-04-19
6
212 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
  • 4
6 Comments
 
LVL 20

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 20

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

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 20

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now