Re: set environment variable
- From: eferreyra <eferreyra@xxxxxxxxx>
- Date: Fri, 21 Nov 2008 06:43:06 -0800 (PST)
Hi, thanks i do that, anyway the wole process is for set envirnment
variables before an user runs his 4gl menu of programs.
In other program that doenst have ui, i just DISPLAY several
MYVAR=123; export MYVAR
then i call it from a shell:
fglgo my4gl >> /tmp/mktempfile
source /tmp/mktempfile
rm /tmp/mktempfile
But now i need to show a options menu so DISPLAY to console cant help
me :)
thanks again!
On 21 nov, 12:16, Mike Aubury <i...@xxxxxxxxx> wrote:
You can't really do that..
You're testing for having set something in the environment from a process
thats been run and finished, and you cant set the environment in a parent
process from a child process.
You can't even do that from a shell script - the closest you can get is
to 'source' the settings so they are read into the current settings. If you
want to take this approach - you might be able to generate a 'settings' file
and then source that, eg :
$ fglgo my4gl
# my4gl generates my4gl.env
$ . my4gl.env
$ echo $MYVAR
You should be able to set the environment variables for use within the 4gl
program by calling the C function putenv or setenv (depending on your
platform) - but that will only set it for programs run from the 4gl program
(eg via a RUN command).
Of course - Aubit4GL has a "aclfgl_setenv" to make this easier ;-)
HTH
On Friday 21 November 2008 14:01:34 eferreyra wrote:
Hi, i note there is not a FGL_SETENV function in traditional Informix
4GL
Anybody has resolved how to set an environment variable (linux, bash)
from 4gl program??
i need:
$ fglgo my4gl
-- my4gl must set MYVAR=SOMEVALUE
$ echo $MYVAR
SOMEVALUE
Can make this works....
Thanks!
_______________________________________________
Informix-list mailing list
Informix-l...@xxxxxxxx
http://www.iiug.org/mailman/listinfo/informix-list
--
Mike Aubury
http://www.aubit.com/
Aubit Computing Ltd is registered in England and Wales, Number: 3112827
Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ
.
- Follow-Ups:
- Re: set environment variable
- From: Mike Aubury
- Re: set environment variable
- References:
- set environment variable
- From: eferreyra
- Re: set environment variable
- From: Mike Aubury
- set environment variable
- Prev by Date: Re: set environment variable
- Next by Date: Re: set environment variable
- Previous by thread: Re: set environment variable
- Next by thread: Re: set environment variable
- Index(es):
Relevant Pages
|