Re: Setting Informix Environment Variables
Posted in 1995
Tony Tyrwhitt-Drake (tonytd@ttyrwhit.demon.co.uk) wrote: : In article <796492472snz@compsys.demon.co.uk>, tech@compsys.demon.co.uk ("tech) says: : > : >...there doesn't appear to be any : >way to set an environment variable from within Informix. : As you probably know :-> unix environment variables are a property of : the shell you are running. Processes can pass them to their children : when they launch them, but children cannot alter the environments of their : parent processes (unless of course somebody can correct me on this) : Which means that there is not much point of setting an environment : var within a 4gl, because when it terminates ,its shell and environment : vars perish with it...unix is not like dos in this respect, or is that : dos is not like unix :-> One trick I have used (not from 4gl) is for the child process to write out a file and then have the parent process "source <file>" . (For csh shell, don't know if other shells have equivalent commands.) This makes the parent and any future children (but not "grandparent") aware of these changes. Of course this is not a general solution as the parent must "know" to execute this source command.