bug-bash
[Top][All Lists]
Advanced

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

Re: problem with pathname expansion


From: vollitwr .
Subject: Re: problem with pathname expansion
Date: Fri, 27 Dec 2013 07:16:12 +0400

Thank you very much.  You had explainded the problem.  However it does
not remove it. :-( It is not bug according to documentation.  But it
is the pure formality only.  It looks like deep and conceptual error
beyond scope of the bash developers.  It is obvious that letters 'b'
and 'B' are different for everybody in any locale but pattern [A-C]
ignores this and nocasematch option. :-( I can only hope that one day
the better concept will be used and this well fortified bug will be
removed... How is it possible to use sequence like aAbBcC... for the
range patterns?!

2013/12/27 vollitwr . <address@hidden>:
> Thank you very much.  You had explainded the problem.  However it does
> not remove it. :-( It is not bug according to documentation.  But it
> is the pure formality only.  It looks like deep and conceptual error
> beyond scope of the bash developers.  It is obvious that letters 'b'
> and 'B' are different for everybody in any locale but pattern [A-C]
> ignores this and nocasematch option. :-( I can only hope that one day
> the better concept will be used and this well fortified bug will be
> removed... How is it possible to use sequence like aAbBcC... for the
> range patterns?!
>
> 2013/12/26 Greg Wooledge <address@hidden>:
>> On Wed, Dec 25, 2013 at 03:11:13PM -0800, Eduardo A. Bustamante López wrote:
>>> On Wed, Dec 25, 2013 at 06:41:17PM +0400, vollitwr . wrote:
>>> > The patterns [A-C] and [ABC] work different!  [A-C] ignores case and
>>> > [ABC] does not.
>>
>> It's not actually ignoring case.  It's just that in some locales, the
>> collating order for letters is something like AaÁáÀàÄäBbCcÇç in which
>> case [A-C] matches AaÁáÀàÄäBbC but not cÇç.
>>
>>> This is not a bug. It's well known that character set ranges depend
>>> on your locale configuration. You seem to be expecting [A-C] to match
>>> ASCII, but your (unspecified) locale expands differently. In
>>> particular, it's the collation order that specifies which character
>>> comes after which.
>>
>> If your locale is set to "C" or "POSIX", [ABC] and [A-C] will be
>> equivalent to each other.  In any other locale, the result of [A-C]
>> is operating-system-specific.
>>
>> http://mywiki.wooledge.org/locale discusses this in a bit more detail.
>>
>> Bash 4.3 (currently in pre-release state) will introduce a new shell
>> option, "globasciiranges", which will cause [A-C] to work as you
>> expect, but this will not be the default behavior.  If you want [A-C]
>> to work like [ABC] by default, then you need to set your locale to C
>> in the shell(s)/script(s) where you want that.



reply via email to

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