bug-bash
[Top][All Lists]
Advanced

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

Re: Subject: inaccurate character class processing


From: Roman Rakus
Subject: Re: Subject: inaccurate character class processing
Date: Tue, 08 Jun 2010 16:25:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc11 Lightning/1.0b2pre Thunderbird/3.0.4

On 06/08/2010 03:48 PM, Iosif Fettich wrote:
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux pony.netsoft.ro 2.6.32.12-115.fc12.x86_64 #1 SMP Fri Apr 30 19:46:25 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.1
Patch Level: 0
Release Status: release

Description:

        (I'm not sure if this a bash or a coreutils issue).

        ls [A-Z]*

        doesn't work as expected/documented.
I'd want/expect it to list the filenames starting with an uppercase letter.

        Thank you for looking at it!


Repeat-By:
        In an empty directory, create files like

        touch a A b B z Z

        Now,

        ls [A-Z]*

        outputs

        A  b  B  z  Z

        (why 'b' and 'z' - and/or where's 'a'...?!!)

        and

        ls [a-z]*

        outputs

        a  A  b  B  z

        (why 'A' and 'B' - and/or where's 'Z'...?!!)




This is locale dependent.

In your locales lower letters are before capital letters, therefore [a-z] does not include capital. In C locales the sequence is capital letters and then lower letters (A B Z a b z).
If you want all letters, lowers and capitals, you can use [a-zA-z]

RR



reply via email to

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