Docker Community Forums

Share and learn in the Docker community.

How to make my alpine linux case insensitive for cd MyFolder and cd myfolder

Hi,

I want to make sure that when I use cd “directoryname”. the directory name should be case insenstive.

cd directoryname and cd DirectoryName should give me the correct answer.

I saw this example.

# If ~/.inputrc doesn't exist yet: First include the original /etc/inputrc
# so it won't get overriden
if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi

# Add shell-option to ~/.inputrc to enable case-insensitive tab completion
echo 'set completion-ignore-case On' >> ~/.inputrc

I put this in a .sh file and call RUN sh ./CaseInsensitive.sh

sh: /root/.inputrc: unknown operand

If this question is answered please direct me to the correct thread.

Thanks a bunch.

Hm … this seems like no Docker issue at all !
First of all, if your Docker container host’s any Linux OS, any “directorynames” are always case-sensitive ! Contray to Windows. So assuming your folders are kept in lower-letters (all the time !) you could use e.g. ‘awk’ to convert the dir-string to all lower letters. Something like this:

$ echo "$include" | awk '{print tolower($0)}' > ~/.inputrc

Second: The error message speaks of an “unknown operand”. As this is (most likely) a bash shell, set completion-ignore-case On is not a valid shell command !

Just threw the Soviet Disc into a Windows 8.1 system and the file names are in uppercase. So my system must be doing something weird here.