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 [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
