> Yes. The issue is that the assignment doesn't make the variable visible,
> when it clearly should.  I've attached a patch that will fix that.

And it does.

> The next version of bash will do things differently, as noted in a
couple of followups to this message. The proposal that prompted the
changes is part of a long thread from December:
http://lists.gnu.org/archive/html/bug-bash/2014-12/msg00115.html

Thanks to you both for the answers. I am glad to see that my original
issue has been fixed.
The thread is indeed long and detailed, so let me just leave a note
about a weird behaviour with 4.4.0 (devel) I have that may or may not be
the intended behaviour.

bash-4.4$ e='(`uname >&2`)'; declare -a a=$e; echo "[$a]"
Linux
[]
bash-4.4$ e='(`uname >&2`)'; declare -a a=$e; echo "[$a]"
[(`uname >&2`)]

As you can see, only in the second case uname is not run. (One can also
type "unset a" to have it execute again.) So there seems to be another
inconsistency.

By the way, I use `cmd` instead of $() because I have this:
$  : $(echo x)
bash: command substitution: line 8: syntax error near unexpected token `)'
bash: command substitution: line 8: `echo x)'

Reply via email to