TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JAMIE KOWINSKY
from: JONATHAN DE BOYNE POLLARD
date: 1998-02-04 16:01:00
subject: Enviorment variables

 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.