bug-bash
[Top][All Lists]
Advanced

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

Re: Unexpected behavior of single quotes when used in the patsub PE.


From: Eduardo A . Bustamante López
Subject: Re: Unexpected behavior of single quotes when used in the patsub PE.
Date: Wed, 20 Mar 2013 22:38:09 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Mar 20, 2013 at 09:15:24PM -0400, Chet Ramey wrote:

> http://lists.gnu.org/archive/html/bug-bash/2012-02/msg00106.html
Ah, I rembember that thread, but somehow just read the beginning of
it. Until now I realize it developed a lot further.

> You say that, but you don't provide any actual evidence to back is up.
> The behavior with this expansion was the same from bash-3.1 (as far back
> as I went) through bash-4.2.

I'm sorry, I meant the change from 4.2 -> 4.3 (don't know the exact
patch level). Running the test script I provided gives the following
output for bash2 and bash3:


===
bash2 2.00.0(1)-release
---
bash2: line 20: unexpected EOF while looking for matching `''
bash2: line 21: syntax error: unexpected end of file
===
bash3 3.00.0(3)-rc1
---
''\'''  |  '
'  |  '
x  |  x
x  |  x
'  |  '
'  |  '
'  |  '
'  |  '
\'  |  '
'  |  '

But I didn't include it initially, because I didn't thought it was
useful. But since you say it's like that since bash 3.1, I guess I
overestimated the behavior.

> Thanks for the script.  I will look at the fix for the bad substitution
> error (I suspect your fix is not correct because the code should not treat
> single quotes as special when parsing a double-quoted string, and the
> error message is printed elsewhere).
Yes, I suspect it's not correct either, but I didn't understand the
bit about removing quotes if the expression was double quoted, so I
went for the straight change that fixed it apparently.

Thanks!

-- 
Eduardo A. Bustamante López

Attachment: pgpqewuKOFkSN.pgp
Description: PGP signature


reply via email to

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