bug-bash
[Top][All Lists]
Advanced

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

Re: Shell substitution with quotes in bash-4.1


From: Chet Ramey
Subject: Re: Shell substitution with quotes in bash-4.1
Date: Thu, 26 Feb 2015 13:03:59 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 2/26/15 1:01 PM, Chet Ramey wrote:
> On 2/26/15 8:20 AM, Corentin Peuvrel wrote:
>> Hello,
>>
>> I found a bug in bash-4.1 (CentOS 6) that was fixed (at least) in bash-4.3
>> (Fedora 21).
>>
>> $ foo=aXb ; echo "$BASH_VERSION : ${foo/X/\'}"
>> 4.3.33(1)-release : a'b
>>
>> $ foo=aXb ; echo "$BASH_VERSION : ${foo/X/\'}"
>> 4.1.2(1)-release : a\'b
>>
>> The shell substitution add the backslash before the quote, but it shouldn't
>> (and ${foo/X/'} fail because it wait for an ending quote).
>>
>> I was wondering if it was possible to backport a fix in 4.1 ?
> 
> No.  The changes were pretty extensive, and I don't have the time
> it would take to port them two versions back.
> 
> You can read the rationale for the changes in all its glory at
> 
> http://austingroupbugs.net/view.php?id=221

Sorry, I should have added that you can work around this by using a
shell variable, as another poster suggested.

-- 
``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/



reply via email to

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