bug-bash
[Top][All Lists]
Advanced

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

Re: Is this a bash wildcard bug?


From: Matthew Woehlke
Subject: Re: Is this a bash wildcard bug?
Date: Thu, 20 Nov 2008 16:01:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.16) Gecko/20080723 Fedora/2.0.0.16-1.fc9 Thunderbird/2.0.0.16 Mnenhy/0.7.5.0

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?

Yes. Your assumptions are wrong.

[a-z] = [aAbBcCdD...xXyYz]
[A-Z] = [AbBcCdDe...XyYzZ]

Now... see why that gives the results you are seeing?

This is FAQ #1 regarding locales (sorry, no links handy, but GIYF). If you want the expected (case-sensitive) behavior, try 'export LC_ALL=C'.

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
C++ is for people who want to be able to not just shoot themselves in the foot, but do it with a rocket launcher. -- Igor Peshansky




reply via email to

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