On Mon, May 21, 2001 at 10:00:05PM -0700, larry a price wrote:
> On Mon, 21 May 2001, Jacob Meuser wrote:
> > A simple test ... well, not really, but it can give some idea of how export
> > works.
> > 
> > $ export THIS=test1 && echo 'export MY_VAR=test2\necho ${MY_VAR}' > ${THIS} \
> > && sh ${THIS} && echo ${MY_VAR} && echo ${THIS}
> >
> ok i just tried this test and i get 
> bash: test1: command not found
> 
> $ cat test1
> export MY_VAR=test2\necho ${MY_VAR}
>                    ^^
> oops. are you using a different shell with different quoting rules?
> obviously not csh cos' i just tried it and it didn't recognize export.
> 
zsh actually. also works in sh and ksh for me. 
changing export to setenv (and removing the =) and changing sh to csh for 
csh gave me:
MY_VAR: Undefined variable.
which was the point of the demonstration.

> > Basically, xdm and getty lose the variable.  They are what start the user
> > sessions, if I'm not mistaken.
> 
> as i understand it.
> /etc/environment is executed at boot
> /etc/profile is executed for every login shell
> 
> if you open a subsidiary shell of any kind it starts off with the
> environment of the login session that spawned it, no?
>
sounds good, but lots of things manipulate environments, or pass on
environments that are /safe/ or /necessary/, especially programs
that allow access to things.
 
> i'm trying to solve a problem of a necessary variable not getting set at
> startup for some reason. 
> 
> mostly i just want to understand the why's and wherefore's ;-)
>
man -k init
man -k rc
or something similar perhaps?

<[EMAIL PROTECTED]> 
> 

Reply via email to