change file names to upper case shell script



for i in ` ls -lrt *.jpg|awk '{print $9}'`; do j=`echo $i | tr '[a-z]' '[A-Z]'`;`mv $i $j`; done

 

#!/bin/sh

 for i in *

 do

 j=`echo $i | tr '[A-Z]' '[a-z]'`

 mv $i $j

 done


or in ksh:
 

 #!/bin/ksh

 typeset -l L

 for i in * do

    L=$i

    mv $i $L

 done

 
# for file in *

                    do

                                        echo $file|tr '[a-z]' '[A-Z]'

               done

 


 

Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post