bug-bash
[Top][All Lists]
Advanced

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

Re: Inconsistent quote and escape handling in substitution part of param


From: Eric Blake
Subject: Re: Inconsistent quote and escape handling in substitution part of parameter expansions.
Date: Wed, 29 Feb 2012 16:11:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 02/29/2012 03:46 PM, Chet Ramey wrote:
> On 2/28/12 12:05 PM, Steven W. Orr wrote:
> 
>>> Look consider this
>>> test=teststring
>>>
>>>
>>> echo "${test//str/"dddd"}"
>>
>> This makes no sense.
> 
> It does when you consider that Posix says (still) that quotes inside
> the ${} must match and affect how the closing `}' is found.

According to POSIX, the moment you get to:

"${test/

the parse is undefined, and the handling of " and finding the closing
'}' are no longer specified by POSIX.  So the question becomes whether
it is smarter to follow the rules for ${test+...} or for ${test%...}
(alas, POSIX does indeed have different rules for determining how " is
treated and how '}' is found in those two setups).

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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