bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on bash clearwildcards


From: Jan Schampera
Subject: Re: Question on bash clearwildcards
Date: Sat, 22 Nov 2008 16:00:14 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]