screen-users
[Top][All Lists]
Advanced

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

Re: environment variables


From: Nico Schlömer
Subject: Re: environment variables
Date: Wed, 11 Dec 2013 12:06:36 +0100

> If you want different behavior, please be more specific
> about what you are really trying to accomplish.

I would like to execute a program in a shell that needs a custom path
added to  LD_LIBRARY_PATH. This happens in my .bashrc by default, so
on the regular non-screen shell I'm getting no problems.
On a detached screen however, the program will not execute with an
error message related to an incomplete LD_LIBRARY_PATH. Indeed,

$ env | grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/home/nschloe/Work/FEniCS/lib/:/opt/trilinos/dev/openmpi/1.4.3/gcc/4.6.3/release/shared/lib/:/opt/netcdf/4.2.1.1/lib/:/home/nschloe/Work/FEniCS/lib:
$ screen -L -d -m sh -c "env | grep LD_LIBRARY_PATH"
$ cat screenlog.0
$

so LD_LIBRARY_PATH doesn't seem to be defined in the detached shell at all.
It *does* get set in attached shells though.

Any workaround for it?

--Nico







On Sat, Dec 7, 2013 at 6:23 AM, David T. Pierson <address@hidden> wrote:
> On Thu, Dec 05, 2013 at 10:08:36PM +0100, Nico Schlömer wrote:
>> I get
>>
>> $ screen
>> --> screen
>> $ echo $FOO
>> bar
>>
>> but a detached shell yields nothing:
>>
>> $ screen -s /bin/bash -L -d -m echo $FOO
>> $
>
> There are a couple of things to say here.
>
> The lack of output has nothing to do with the environment variable.  The
> echo command is running within the new screen session, to which you are
> not attaching (and which will exit after echo exits.)  So nothing should
> appear as output in the current shell.  Try:
>
>   $ screen -d -m echo foo
>
> to see the same thing (nothing) in your current shell.
>
> However, since you used -L to enable logging, you should see the output
> in the log.
>
> Finally, note that $FOO gets expanded by the current shell before screen
> is invoked.  If you want different behavior, please be more specific
> about what you are really trying to accomplish.
>
> David
> is invoked.  If you want different behavior, please be more specific
> about what you are really trying to accomplish.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]