[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inconsistent quote and escape handling in substitution part of param
From: |
Chet Ramey |
Subject: |
Re: Inconsistent quote and escape handling in substitution part of parameter expansions. |
Date: |
Tue, 28 Feb 2012 17:15:29 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
On 2/28/12 5:07 PM, Chet Ramey wrote:
>> yhea but I think the point is that the current behavior is useless.
>> there is no case where I want a " to be printed and start a double
>> quoted string? and thats the current behavior.
>>
>>
>> Not so important how you treat it just need to pick 1. then you can at
>> least work with it. Now you have to use a temp variable.
>>
>>
>> as a side note ksh93 is pretty good, intuitive
>> ksh93 -c 'test=teststrtest ; echo "${test//str/"dd dd"}"'
>> testdd ddtest
>> ksh93 -c '( test=teststrtest ; echo ${test//str/"dd '\''dd"} )'
>> testdd 'ddtest
>
> The real question is whether or not you do quote removal on the stuff
> inside the braces when they're enclosed in double quotes. Double
> quotes usually inhibit quote removal.
>
> The Posix "solution" to this is to require quote removal if a quote
> character (backslash, single quote, double quote) is used to escape
> or quote another character. Somewhere I have the reference to the
> Austin group discussion on this.
http://austingroupbugs.net/view.php?id=221
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., (continued)
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Maarten Billemont, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Steven W. Orr, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Chet Ramey, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Chet Ramey, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions.,
Chet Ramey <=
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Chet Ramey, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Maarten Billemont, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Chet Ramey, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Chet Ramey, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., Chet Ramey, 2012/02/29
- Re: Inconsistent quote and escape handling in substitution part of parameter expansions., John Kearney, 2012/02/28