Sign in to follow this  
Followers 0
Tobias Solem

Renaming uppercase to lowercase in Linux

1 post in this topic

The problem:

The issue with Exilemod and ARMA3 addons is that they do not bother with taking care of uppercase vs. lowercase whereas in Linux if you call for a file named Banana_Feature.sqf it won't work if that file is named banana_FEATURE.sqf, because Linux is inherently case-sensitive (meaning two or more files with the same name can exist in a folder if they have different variants of upper/lowercase).

The solution

While this remains an issue (because mod developers keep not caring about case-sensitivity) the best solution is to rename all uppercase files and folders to lowercase, and while this of course can be done manually, there is an automated way to do this:

1. create a file called in the directory where you want to change the files, or in your path:  $ nano -w

2. paste the following into that file:

for SRC in `find * -depth`
    DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
    if [ "${SRC}" != "${DST}" ]
        [ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" || echo "${SRC} was already all lowercase."

3. Change the permissions of that file so you can rename it: $ chmod 750

4. Execute your file (my example is if the script is in the same directory): $ ./


The script will find all the files in the directory and check them for uppercase letters and convert them to lowercase letters, every non-alphabetic letter it will ignore. It will also report the results, and throw out "<filename> was already all lowercase" if it thinks it doesn't have any caps.


4 people like this

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.