On Sun, Mar 04, 2018 at 06:15:05PM -0500, Zach Hadgraft wrote:
> Description:
>         global variable assignments fail when part of a sequence that
> includes read and begins with a function invoked by command substitution
>         read can be invoked by another function, or invoked by another
> command and the result is the same

As Chet said, command substitution runs in a subshell, which means
side effects (global variable changes, changing directory, etc.) are
discarded.

If your actual goal is to send information from a function back to the
caller, please see <https://mywiki.wooledge.org/BashFAQ/084>.

Reply via email to