On Mon, 25 Jul 2011 14:28:52 -0700, Linda Walsh <b...@tlinx.org> wrote:
> Not really. > It only seems that way because within () any "$xxxx" is usually > expanded BEFORE the () starts from the parent.... > > You can see this by > GLOBAL="hi there" > (echo $GLOBAL) > prints out "hi there" as expected, but if we hide > $GLOBAL so it isn't seen by parent: > (foo=GLOBAL; echo ${!foo}) > prints "" > > So, they aren't really available in a subshell, only > that a subshell's contents are evaluated before the subshell is > called. There is a distinction to make between exported and non-exported variables. Also, foo=bar command is quite different from foo=bar; command (although sometimes, under certain conditions, they may appear to yield the same result). -- D.