[GRASS-dev] trying to set environment vars from a C program
Benjamin Ducke
benjamin.ducke at ufg.uni-kiel.de
Sun Dec 17 10:39:00 EST 2006
hi all,
I am working on a set of modules to integrate GRASS with R.
For this I need to read and set some global variables for R scripts to
use.
I would like to use shell environment variables for this and
set them through a C module.
However, if I use the C function setenv() in program foo.c, it seems to
only add variables to the environment of foo.c.
When foo.c terminates, all variables set with senenv() will be gone.
I have not found a way to modify the environment of the shell that
starts foo.c so that the new variables will be available in the calling
shell after foo.c has exited.
Is this somehow possible or will I have to fall back to storing
variables and values in an ASCII file?
Thanks,
Benjamin
--
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany
Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg
More information about the grass-dev
mailing list