WTF bash!
Posted by nuxi on 2009-Nov-04 at 11:56:43 in Computers (Login to reply)
This is the classic asciibetical mode, its always case sensitive:
nuxi@nobel:~/wtf(0)$ echo $LC_COLLATE
C
nuxi@nobel:~/wtf(0)$ ls
Makefile makefile
nuxi@nobel:~/wtf(0)$ ls m*
makefile
nuxi@nobel:~/wtf(0)$ ls [m]*
makefile
nuxi@nobel:~/wtf(0)$ ls [mn]*
makefile
nuxi@nobel:~/wtf(0)$ ls [m-n]*
makefile
Now here is the en_US mode, its sometimes case sensitive and sometimes not:
nuxi@nobel:~/wtf(0)$ echo $LC_COLLATE
en_US.UTF-8
nuxi@nobel:~/wtf(0)$ ls
makefile Makefile
nuxi@nobel:~/wtf(0)$ ls m*
makefile
nuxi@nobel:~/wtf(0)$ ls [m]*
makefile
nuxi@nobel:~/wtf(0)$ ls [mn]*
makefile
nuxi@nobel:~/wtf(0)$ ls [m-n]*
makefile Makefile
And this is why I always set LC_COLLATE to C even when I run Unicode stuff.