On , William Mcbrine (1:109/570@fidonet) wrote:
JK> Can anyone post some sample code on how to read enviorent vars from
JK> the current enviorment
> getenv()
OK so far...
JK> and if possible how to modify them?
> setenv(), putenv(), unsetenv()
No guaranteed portability by any standards!
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.
> I believe these calls are POSIX, so no problem there.
Only getenv() is in Posix.1. There is no standard way to set environment
variables from a C program. Setting an environment block pointer in an exec()
call and putenv() are the most commonly supported non-standard methods. Note
that even these will *not* set the parent or master environment, only the
environment passed to subordinate processes.
--- QM v1.00
---------------
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6)
|