[Top][All Lists]

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

empty quotes break pattern replacements in bash-4.2

From: Mike Frysinger
Subject: empty quotes break pattern replacements in bash-4.2
Date: Fri, 18 Feb 2011 21:06:16 -0500
User-agent: KMail/1.13.5 (Linux/2.6.37; KDE/4.5.5; x86_64; ; )

this simple code no longer works in bash-4.2:
$ f=abc; echo ${f##""a}
same goes for ${f//""a} and ${f%%""c}, and perhaps more operations

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.

Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

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