[CLUE-Tech] Shee/export thing
Jed S. Baer
thag at frii.com
Thu Nov 15 10:08:56 MST 2001
On Thu, 15 Nov 2001 09:40:39 -0700
Grant Johnson <grant at amadensor.com> wrote:
> After
> testit
> grant at c70051-a:~/test > echo $bogus
> testit
> grant at c70051-a:~/test >
>
>
> When I just ran it and exported the env var, it didn't do anything to my
> current shell, but when I did a "dot-space" before it, it worked. WTH?
> I don't get why. I just swiped this off an example. I don't know why
> it is this way.
It's because when you don't use the ". space" notation, it runs in a
sub-shell. That notation is called "sourceing" the script, BTW.
env vars set in sub-shell (i.e. child process) don't get set in the
current process. However, exporting a variable causes it to be propogated
"down" to subshells. Propogation doesn't work "up" though.
--
If R is the set of all sets which don't contain themselves,
does R contain itself?
More information about the clue-tech
mailing list