Export variable across new screens under "Screen"?

Export variable across new screens under "Screen"?

Post by o.. » Sat, 18 Nov 2000 04:00:00



export MYVARIABLE=Something
Doesn't work when another screen under "Screen" is started.
Is it possible to do this at all? Im using Screen under the Bash
shell.

Thanks,

-Tony

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Export variable across new screens under "Screen"?

Post by Derek M. Fly » Sat, 18 Nov 2000 04:00:00



> export MYVARIABLE=Something
> Doesn't work when another screen under "Screen" is started.

Correct.

Quote:> Is it possible to do this at all? Im using Screen under the Bash
> shell.

Not without doing something (like setting it again, or reading it
from a file).  Each shell in a screen virtual terminal is a separate
shell, so they do not share their environment.

 
 
 

Export variable across new screens under "Screen"?

Post by Kenny McCorma » Sat, 18 Nov 2000 04:00:00





>> export MYVARIABLE=Something
>> Doesn't work when another screen under "Screen" is started.

>Correct.

>> Is it possible to do this at all? Im using Screen under the Bash
>> shell.

>Not without doing something (like setting it again, or reading it
>from a file).  Each shell in a screen virtual terminal is a separate
>shell, so they do not share their environment.

You can set the variable into Screen's environment by doing ^A:setenv foo bar
(that is, using the screen setenv command).  That will set it for all newly
created shells (existing shells are, of course, unaffected).
 
 
 

Export variable across new screens under "Screen"?

Post by o.. » Sun, 19 Nov 2000 15:30:03


Since I need this done in a Bash script I think my only alternative is
to write the variable to a file. I can use my ram drive for this.

Thanks,

-Tony

Quote:> >> export MYVARIABLE=Something
> >> Doesn't work when another screen under "Screen" is started.

> >Correct.

> >> Is it possible to do this at all? Im using Screen under the Bash
> >> shell.

> >Not without doing something (like setting it again, or reading it
> >from a file).  Each shell in a screen virtual terminal is a separate
> >shell, so they do not share their environment.

> You can set the variable into Screen's environment by doing ^A:setenv
foo bar
> (that is, using the screen setenv command).  That will set it for all
newly
> created shells (existing shells are, of course, unaffected).

Sent via Deja.com http://www.deja.com/
Before you buy.