Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

Cpoying files UPPERCASE

How can I copy files if I want their names to be always in Uppercase?
0
rolli
Asked:
rolli
  • 4
1 Solution
 
tfewsterCommented:
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
 
tfewsterCommented:
As you haven't given us any feedback I'll assume my comment gave you what you needed :)
0
 
rolliAuthor Commented:
It would be an excellent answer, but I need the files inside the folders to be 'uppercased' as well, so keep trying!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
tfewsterCommented:
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
 
ozoCommented:
perl -MFile::Find -e 'find(sub{rename $_,uc $_ or warn "$_:$!" if /[a-z]/ },".")'
0
 
tfewsterCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now