[Top][All Lists]

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

Re: empty quotes break pattern replacements in bash-4.2

From: Chet Ramey
Subject: Re: empty quotes break pattern replacements in bash-4.2
Date: Fri, 18 Feb 2011 23:17:11 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

On 2/18/11 9:06 PM, Mike Frysinger wrote:
> this simple code no longer works in bash-4.2:
> $ f=abc; echo ${f##""a}
> abc
> same goes for ${f//""a} and ${f%%""c}, and perhaps more operations

One more: everything that calls getpattern().

> removing the quotes, or quoting the single char in question, makes it work:
> $ f=abc; echo ${f##a} ${f##"a"}
> bc bc
> the original bug report uses variables in the pattern and quotes them to 
> avoid 
> expansion of globs and such.  but if the variable happened to be empty, 
> things 
> no longer worked correctly.

Try this patch.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

Attachment: rhs-split.patch
Description: Text Data

reply via email to

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