Re: Changing the ENV
Posted in 1995
At 08:17 AM 5/23/95, Robert Minter wrote: }For all who are curious, how do you alter the environment while running }a 4gl program? I've tried this: } }MAIN }DEFINE arg_str CHAR(20) } LET arg_str = fgl_getenv("ROBS_ENV") } DISPLAY "arg_str = ", arg_str CLIPPED } RUN "ROBS_ENV=hello ; export ROBS_ENV" } LET arg_str = fgl_getenv("ROBS_ENV") } DISPLAY "arg_str = ", arg_str CLIPPED }END MAIN } }and both displays are blank. Any clues? Someone correct me if I'm wrong, but I believe when executing the "run" from a 4GL application, it in fact creates a new shell, in which your commands are run. Because of this, your above example creates a sub-shell (under the current), then sets the environment variable, then exits the shell. Shell/environment attributes are inherited down, not up, thus after executing your command in this sub-shell, the shell is closed, and setting lost. Jon } } Robert Minter Data Systems Support \\\\\\_/// }Senior Software Engineer A Client Technologies Company ( _ _ ) }E-Mail: rob@dssmktg.com Tel: 714.771.0454 (| ^ |) }#include <disclaimer.h> Fax: 714.771.3028 \\`-'/ }De Colores - Emmaus OC-13 SURF'S UP \\_/ } } ================================================================== Jon Vemo Internet: jvemo@cyberspace.com Bothell, WA USA ------------------------------------------------------------------ Watch out for road-kill on the information superhighway....SPLAT!! ==================================================================