bug-bash
[Top][All Lists]
Advanced

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

Re: inappropriate brace expansion in command substitution


From: Chet Ramey
Subject: Re: inappropriate brace expansion in command substitution
Date: Mon, 16 Jan 2012 15:11:40 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 1/16/12 2:14 PM, Greg Wooledge wrote:
> Someone in IRC was doing an overly complex command invovling grep "^.{1,8}"
> inside a command substitution, and we believe he stumbled upon a bash bug.
> I've simplified it down to this:
> 
> $ echo "$(echo "a{1,8}")"
> a1 a8
> 
> The curly braces here should not be treated as a brace expansion, since
> they're obviously inside a quoted argument.

The curly braces shouldn't be handled by the "outer" shell anyway, since
they're part of a command substitution.  (The quotes inside the command
substitution should not be misinterpreted as terminating the outer quoted
string.)  This was already reported and fixed for the next bash releaes.

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/



reply via email to

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