delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/25/09:32:52

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to read/modify environment variables?
Date: Tue, 24 Jun 1997 19:44:18 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 21
Message-ID: <33B02392.4151@cs.com>
References: <33B013CC DOT E452725B AT po DOT uni-stuttgart DOT de>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp102.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Martin Bernreuther wrote:
> 
> I like to write a small tool to add a path to the PATH variable
> only if it's not already in.
> How can I get a hold of the environment variables?
> Is there already a tool to do this?
> Is there maybe a tool just to search a environment variable for
> a string?

getenv().  Look it up in the libc docs.  See also its complement,
putenv().

-- 
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019