[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do? Possible?

From: Davide Brini
Subject: Re: How to do? Possible?
Date: Mon, 25 Jul 2011 23:59:54 +0200

On Mon, 25 Jul 2011 14:28:52 -0700, Linda Walsh <address@hidden> 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.

foo=bar command

is quite different from

foo=bar; command

(although sometimes, under certain conditions, they may appear to yield the
same result).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]