Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Case insensitive file name globbing is not working in bash on Ubuntu 11.04 64bit. The shell options specified in .bashrc are as follows:

shopt -s nocaseglob 
shopt -s nocasematch

shopt also shows that nocaseglob and nocasematch are on. But for a directory change or opening a file, it doesn't work in case insensitivity mode.

I wish to check whether any other option is needed to enable case insensitive filename globbing.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Are you really doing globbing, i.e. wildcard expansion? For example, suppose that you have a directory called Foobar. Then

cd foobar

doesn't do globbing, because there is no wildcard character. When you specify a file name exactly, it's up to the application to decide what to do with it, and since unix file names are case sensitive, the application will not open a file called Foobar if you tell it to open a file called foobar.

On the other hand,

cd foo*

will change to the Foobar directory (assuming there is no other match), if you've set the nocaseglob option.

You can make completion case-insensitive too. Put set completion-ignore-case on in ~/.inputrc, or

bind set completion-ignore-case on

in ~/.bashrc. Then after entering cd foo and pressing Tab, the shell will complete Foobar.

share|improve this answer
    
Thank you very much Gilles.It solved the issue.. –  padmakumar Jul 13 '11 at 6:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.