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

Re: setenv



Shlomi Fish wrote:
> 
> Well, it seems I was a bit mistaken about the Bourne Shell (sh, bash).
> Let me make the "EXPORT" stuff clearer:

	[snip - a tutorial on Bourne shell variables]

> The "export VAR" command is required to pass variable to child
> scripts, because otherwise the variable VAR will remain only in the
> shell private variables which are not inherited by them.
> 
> Messy, isn't it?

That is why C-shell uses the setenv command instead: the environment
variables are clearly separate from the shell's local (i.e., private)
variables.  Only the environment variables are passed to any child
process (i.e., through the fork) including into sub-shells.

>         Shlomi Fish

-- 
Eliyahu Skoczylas <eliyahu@photonet.com>     Internationalization Coord.
PictureVision, Ltd. R&D for the PhotoNet -      "Your Photos on the Net"
http://www.photonet.com/ "With PhotoNet,every camera's a digital camera"


References: