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: Chet Ramey
Subject: Re: Inconsistent quote and escape handling in substitution part of parameter expansions.
Date: Tue, 28 Feb 2012 19:56:39 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 2/28/12 5:49 PM, John Kearney wrote:
> On 02/28/2012 11:44 PM, Chet Ramey wrote:
>> echo "$(echo '$bar')"
> 
> actually these both output the same in bash
> echo "$(echo '$bar')"
> echo $(echo '$bar')

Sure: the outer quotes don't affect the command between the parens.  Not
only is it a new quoting context, it's a new parsing context entirely.
Parameter substitutions don't work like that.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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