Environment variables

Conor P. Cahill cpcahil at virtech.UUCP
Fri Sep 15 14:22:48 AEST 1989


In article <57732 at aerospace.AERO.ORG>, louis at 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     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.wizards mailing list