passing environment variables through to screen

View: New views
3 Messages — Rating Filter:   Alert me  

passing environment variables through to screen

by Bugzilla from markd@kermodei.com :: Rate this Message:

| View Threaded | Show Only this Message


Is there a way to cause screen to pass through environment
variables when invoked?

My particular problem is TMPDIR, which varies on different
systems we have.

Thanks!

_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users

Re: passing environment variables through to screen

by Kevin Van Workum-4 :: Rate this Message:

| View Threaded | Show Only this Message

As far as I know, screen behaves like any other process and inherits its environment. So invoking screen as follows should work, if not, then you have some other problems.

TMPDIR=/some/dir screen


On Mon, Jul 2, 2012 at 3:20 PM, Mark Diekhans <markd@...> wrote:

Is there a way to cause screen to pass through environment
variables when invoked?

My particular problem is TMPDIR, which varies on different
systems we have.

Thanks!

_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users



_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users

Re: passing environment variables through to screen

by Bugzilla from markd@kermodei.com :: Rate this Message:

| View Threaded | Show Only this Message


Thanks for the response.  In case this hits anyone else, the
problem is this is a Linux security measure due to screen being
setgid.  This seems Linux-specifc in the system and specific to TMPDIR
and certain other environments variables.  See below.  It's
mentioned here:

         https://bugzilla.redhat.com/show_bug.cgi?id=129682#c1

Although this is not documented in man ld.so(8) as suggest in
one of the postings.

The best work around I can see is to have TMPDIR set in
/etc/screenrc.

Mark

FreeBSD 8.2, OS/X 10.7.4:
    TMPDIR=/var/barney FRED=fred screen
    echo $TMPDIR
    /var/barney
    echo $FRED
    fred

CentOS 5.2, Ubuntu 12.0
    TMPDIR=/var/barney FRED=fred screen
    echo $TMPDIR
    bash: TMPDIR: unbound variable
    echo $FRED
    fred


Kevin Van Workum <vanw+screen@...> writes:
>    As far as I know, screen behaves like any other process and inherits
>    its environment. So invoking screen as follows should work, if not,
>    then you have some other problems.

_______________________________________________
screen-users mailing list
screen-users@...
https://lists.gnu.org/mailman/listinfo/screen-users