The export cascade, from the parent side
The export cascade, from the parent side
Answer
X=1 export X echo "outer before: $X" sh inner echo "outer after: $X"
Both echo lines print 1, however hard the child works to change it. Delete line 2 and the child sees the null string instead, because nothing was placed in the environment for it to inherit.
S&K 3e ch12 §12.3.3–12.3.6