[Top][All Lists]

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

Re: Incorrect alias expansion within command substitution

From: Chet Ramey
Subject: Re: Incorrect alias expansion within command substitution
Date: Fri, 4 Feb 2022 14:18:13 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

On 2/3/22 9:46 PM, Alex fxmbsw7 Ratchev wrote:

    The case I had in question with the question about $( a b ) was this

             cat <<$( a b )
             $( a b )

i think you are mis understanding the differencies here between shell expression parsing, and a rather data only part which applies here that is, <<{word} is a word and is threated as flat text word, in further eof recognition, applying advanced expressions here seems me like an early bug

It is a WORD (in the POSIX grammar sense), and so recursive parsing and
alias expansion are required as soon as you hit the `$('. It's what you
do with the word once you have it that matters.

imho the example above should have resulted in error ')'
it would execute cat a b ) with hello till $( then rather \n and a b ) again, useless
especially the $( wasnt even quoted

What can this possibly mean? What semantic interpretation would lead you
to the conclusion that you should stop reading the token after a `$(' in
this one specific case?

chet didnt you say there were no bugs ? =)

I didn't, but how is that relevant here?

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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