Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How to refer variable defined in sub shell in parent shell. command grouping is difficult in my case. What would be the alternative.
If you have defined a variable in a subshell (and export that), it won't be propagated to the parent's environment. This is by design.
You can only pass them downwards, meaning to only the child's environment.