Re: Problem with i4gl, fgl_getenv() and $RANDOM, $SECONDS, $$...
Posted in 1997
On Thu, 18 Dec 1997, J.Miguel Signes wrote: > Do you know how to get $RANDOM or some other non-character environment > variable of ksh into a program variable in i4gl?. I've tried with > fgl_getenv() and it just doesn't work. The reason it doesn't work is that $RANDOM etc are not, by default, environment variables -- they aren't exported. You can verify this by running: env | egrep 'SECONDS|RANDOM' You should be OK if you do export RANDOM SECONDS: (export RANDOM SECONDS; env | egrep 'SECONDS|RANDOM') but be aware that the value of neither will change while the I4GL program is running. This is why they are not exported. You can also do things like export PPID, but the value is inaccurate in the subshell -- it refers to the parent PID of the shell, not of the I4GL program. Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>