louis@aerospace.aero.org (Louis M. McDonald) (09/14/89)
I would like to have a program permanently set environment variables. I guess I thought putenv would do it, but seem to be wrong. After the program completes, the enviroment variables are the same (if already exist) or do not exist (if new). Basically, I would like to have something that does not require me to have a user `source' a file to get the environment variables I want defined for his/her session. Louis McDonald -- Louis McDonald The Aerospace Corporation louis@aerospace.aero.org
cpcahil@virtech.UUCP (Conor P. Cahill) (09/15/89)
In article <57732@aerospace.AERO.ORG>, louis@aerospace.aero.org (Louis M. McDonald) writes: > Basically, I would like to have something that does not require me to > have a user `source' a file to get the environment variables I want defined > for his/her session. If you are using the [c|k|ba]sh, you can create an alias which sources the shell that sets the environment vars you want. The standard shell and Ksh ( not sure about bash) also allows the use of shell functions which will have the effect you want. For ex: Under the ksh: alias use_this_environ=". $HOME/envvars" or use_this_environ() { new_var=.... } BTW, even within the same program putenv() will not correctly work unless you use non-automatic data for the environment strings that you are adding. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+