JK> Can anyone post some sample code on how to read enviorent vars from
JK> the current enviorment, and if possible how to modify them?
To read the current environment, use the Standard C++ library function
getenv(). There is no Standard C++ library function to modify the
environment, *BUT* ...
JK> The system I am working with is HP-UX 10.20 but would also like the
JK> code to work with a Linux system.
... since you are targetting systems that both attempt to be compliant with
the POSIX standard (ISO IEC 9445-1:1993), then you can almost certainly use
putenv(). Some unix C libraries also support setenv() and unsetenv().
As always on a unix or linux system, the man pages are your friends (assuming
you know where to look -- which you now do).
¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)
|