Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • rui@ruir:~$ b=1 rui@ruir:~$ bash rui@ruir:~$ echo $b (nothing) Commented Feb 11, 2016 at 2:34
  • 1
    @RuiFRibeiro: You were confused between child process environment and subshell environment. Commented Feb 11, 2016 at 2:35
  • thanks. In my example,b isn't an environment variable, why is c assigned the value of b by command substituion? Commented Feb 11, 2016 at 2:49
  • I took the liberty of editing the English, and made a word change that I think will help @Tim understand better the issue of his last question. Commented Feb 11, 2016 at 3:00
  • @Rui: Does the reply answer my question in my last comment, which is also in my post? I.e. In my example, b isn't an environment variable, so b doesn't exist in the subshell, why is c assigned the value of b by command substituion? Commented Feb 11, 2016 at 3:20