[svlug] Adding environment variable to a shell and it's subprocesses?

Rafael Skodlar raffi at linwin.com
Fri May 30 14:45:49 PDT 2003


On Fri, May 30, 2003 at 02:13:50PM -0700, Roland Krause wrote:
> Is there a way under Linux and bash/tcsh to add a environment variable

Thou shall not use csh/tcsh!

> to a shell that's running noninteractively and to propagate the
> variable to it's subprocesses? 

How about reading some file that can be modified at any time (vi, etc.)?
You could put anything you want in there and read it from the
subprocess.

MYVAR=foobar
export MYVAR

for example. You could check for modification time to that file
periodicaly before actualy reading it.

I'm sure there are other ways to do it.

> 
> Say that I have started a program from within KDE's windowmanager and
> that I want this program to recognize that a certain environment
> variable has been set that was not set when the user logged in.
> 
> Is this possible at all? I wouldnt even mind restarting the app but it
> *must* be without starting a terminal/shell/konsole etc. 
> 
> Any pointers welcome.
> Roland

-- 
Rafael




More information about the svlug mailing list