Re: strange expansion of <(cat p.main.{optional,extra})
From:
Chet Ramey
Subject:
Re: strange expansion of <(cat p.main.{optional,extra})
Date:
Wed, 18 Apr 2007 22:36:24 -0400
User-agent:
Thunderbird 2.0.0.0 (Macintosh/20070326)
Stephane Chazelas wrote:
> On Tue, Apr 17, 2007 at 08:16:53PM -0400, Chet Ramey wrote:
> How does it get exanded to
>
> echo <(cat p.main.optional) <(cat p.main,extra)
>
> though?
>
> If it were textual, I would expect:
>
> echo <(cat p.main.optional) p.main,extra)
It's still a word expansion. The parser splits the input into words
before brace expansion takes place.
>
> And what about:
>
> echo $(cat p.main.{optional,extra})
>
> This resolves to
>
> echo $(cat p.main.optional p.main.extra)
>
> I can't see any reason why $(...) and <(...) should be treated
> differently.
Yes, that's a separate issue worth consideration. There is already code
to treat command substitution specially and defer expansion to the
subshell. It might be a good idea to treat process substitution the same
way.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/