dynamically set and change ENV variable, systemwide
Hi,
I'm setting env variable as usual:
$ setenv MYPROJECT currentproject
$ echo $MYPROJECT
currentproject
But when I open new terminal window/tab, my env is destroyed and no longer available.
$ echo $MYPROJECT
MYPROJECT: Undefined variable.
I want dynamically (via scipt) change/set env variable that will be available under all terminal windows. I am using it to set what current project I am working on, and I want this variable to be available to every application system wide. And of course I can change which 'project' I am working on by changing $MYPROJECT
How can I achieve that ?
What conditions determine the environment variable? You say you want to set dynamically, but do not give an example of the variable you are setting.
There is no really more to it. When I am working on a project, I want to set my env variable $MYPROJECT to that project name. And at the same time, I want all my apps on the system to retrieve that information (check that currently i am working on $MYPROJECT). I will be changing this variable to different if I am working on a different project of course
How do you currently set the project variable? Do you manually do it, or is the project name in a file, that could be used as input for a script to use?
I am manually sourcing script with 'setenv $MYPROJECT $argv[1]'.
It works 'well' within a realm of terminal where it was sourced from, but not outside. I would like to set this variable even from 'stand alone' QT app (which would source that setenv script when button pressed)