Re: lowercase to uppercase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Justin Banks wrote:
RedHat wrote
  
Hello.
I am looking for a way to permanently change  the contents of a 
directory from lowercase to uppercase.
If I input the command:

echo *.* | tr a-z A-Z

it outputs a list of the files in uppercase but doesn't actually change 
them.
Can anybody help out?
Thanks
    

The Perl Cookbook has a great little snippet for doing this kind of thing
that's extremely useful :

http://www.the-node.org/oreilly/perl/COOKBOOK/CH09_10.HTM

-justinb

  
This worked for me.

for i in *
do
        echo "${i} \c"
        if [ $0 = "lcase" ]
        then
                mv  ${i} `echo ${i} | tr "[A-Z]" "[a-z]"`
        else
                mv  ${i} `echo ${i} | tr "[a-z]" "[A-Z]"`
        fi
done
echo "\nDone with ${0} "



[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux