I’ve noticed for a while now that, on some of the Unix-based systems I use at least, ls [A-Z]* has been giving me the results I would anticipate from ls [A-Za-z]*, leaving me unable to easily get a list of just the goddamned files that start with capital letters. I just now ran into the same thing with grep, where I could not get it to stop matching lowercase letters with [A-Z] until I eventually used grep -P to get Perl regex.
So I have some related questions:
- When did this idiocy start?
- Who is responsible and needs to be punished?
- WHY???
- Is there some reasonably simple workaround for either or both of the
lsandgrepcases? (Trying, for example,grep --no-ignore-casewas fruitless.grep -Pis not a very good workaround because of its experimental feature status.)
It’s actually
[A-Za-y], and it has to do with language collation. If you want to override it then set$LC_COLLATEappropriately; either ofCorPOSIXshould do.