bug-bash
[Top][All Lists]
Advanced

[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:11:22 -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 4:20 PM, Robert Elz wrote:

   | and it's just
   | as clear that, let's say, implementations differ in this area.

Aside from bash 5.2, not really.   There are lots of implementation bugs
are limitations, but not really any expectation that the here doc end
word text can be modified (beyond quote removal).

Wait, what are we talking about here? If we're talking about alias expansion inside here-document delimiters containing command substitutions,
the only thing common is the error. If we're talking about whether or not
the spaces are preserved in $( a b ), there are again several different
outputs.

   | I'm comfortable with not supporting this use case.

Fine, I doubt you'll ever encounter anything like that in the wild, but you
are breaking backwards compat with bash up to 5.1 when you do that.

The first half of your sentence mitigates the issue in the second half. I
think it's more important to get the other posix conformance issue right.



   | > cat <<$(cat</dev/null)
   | > hello
   | > $(cat</dev/null)
   |
   | It's not because the reconstituted text doesn't include redirections; the
   | error message tells you that.

No err message, bash (5.2-xxx) just sat there (at PS2) waiting for more
input, until I SIGINT'd it.   I do most of these tests interactively, not
in scripts, unless there is a real need (or they are very long).

Ah. I use the opposite approach. It usually produces more effective
results, especially if I need to start a debugger.

--
``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]