grendelos wrote: > So this is really bugging me. Why is [a-z] not case sensitive, but [A-Z] is? > For example: > > # ls -l > total 0 > -rw-r--r-- 1 root root 0 Nov 20 12:22 xa > -rw-r--r-- 1 root root 0 Nov 20 12:22 xA > > # ls -l x[a-z] > -rw-r--r-- 1 root root 0 Nov 20 12:22 xa > -rw-r--r-- 1 root root 0 Nov 20 12:22 xA > > # ls -l x[A-Z] > -rw-r--r-- 1 root root 0 Nov 20 12:22 xA > > Any ideas? > > grendelos
This all depends on locales. It's useless to assume that "A-Z" or "a-z" is something about the case. See that sequence: AaBbCcDd....Zz Now think what "from A to Z" means here. It's all those letters except "z". Another sequence: ABCD...abcd... Here, "from A to Z" means what you *think* it always means. Consider to use [[:aplha:]], [[:upper:]] and [[:lower:]] if possible. J.