bug-bash
[Top][All Lists]
Advanced

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

Re: [bash4.2] ${v//[/} bug?


From: Dennis Williamson
Subject: Re: [bash4.2] ${v//[/} bug?
Date: Tue, 15 Feb 2011 21:56:30 -0600

On Tue, Feb 15, 2011 at 9:54 PM, Dennis Williamson
<dennistwilliamson@gmail.com> wrote:
> On Tue, Feb 15, 2011 at 9:16 PM, Clark J. Wang <dearvoid@gmail.com> wrote:
>> On Wed, Feb 16, 2011 at 9:59 AM, Chet Ramey <chet.ramey@case.edu> wrote:
>>
>>> On 2/15/11 6:18 AM, Clark J. Wang wrote:
>>> > For following script:
>>> >
>>> > var='[hello'
>>> > echo "${var//[/}"
>>> >
>>> > With bash 4.1 it outputs hello but with 4.2 it outputs [hello . And bash
>>> 4.2
>>> > with compat41 on still outputs [hello . Bug? Or Bug fixed?
>>>
>>> It's a bug, and I will release a patch.  In the meantime, see if the
>>> attached patch does the right thing on your platform.
>>>
>>> The patch fixed this simple example but it does not work for more
>> complicated scenario:
>>
>> bash# cat foo.sh
>> var='[hello'
>> echo "${var//[/}"
>>
>> red='\[\e[0;31m\]'
>> echo "${red//\\[\\e/}"
>> bash# /usr/local/bash-4.1.9/bin/bash foo.sh
>> hello
>> [0;31m\]
>> bash# /usr/local/bash-4.2.0/bin/bash foo.sh
>> [hello
>> \[\e[0;31m\]
>> bash# /usr/local/bash-4.2.0-fix/bin/bash foo.sh
>> hello
>> \[\e[0;31m\]
>> bash#
>>
>> Chet
>>> --
>>> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>>>                 ``Ars longa, vita brevis'' - Hippocrates
>>> Chet Ramey, ITS, CWRU    chet@case.edu
>>> http://cnswww.cns.cwru.edu/~chet/
>>>
>>
>>
>>
>> --
>> Clark
>>
>
> Also, 4.0.33 and 3.2.0 pass, 2.05b and 4.2.0 fail.
>

I should have been clear that that applies to the more complex example.



reply via email to

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