Unix Programming - Global change in environment variables from inside C programs

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2004 > Global change in environment variables from inside C programs





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Global change in environment variables from inside C programs
Rajarshi Chakraborty

2004-01-28, 2:35 pm

Hi,

How can I make global changes to environment variables in Linux/Unix
from inside C programs? I want this modified value to be available to
independent scripts/processes. I figured, sentenv()/putenv() don't
change the values of the environment variables permanently. So by what
other way can I achieve this? Any suggestion will be highly
appreciated.

Best regards,
Rajarshi

p.s. This is needed for communication between a server and a CGI
script (written in perl) using environment variables.
Barry Margolin

2004-01-28, 2:35 pm

In article <493414aa.0401281922.62c4c427@posting.google.com>,
systems_420@yahoo.com (Rajarshi Chakraborty) wrote:
quote:

> Hi,
>
> How can I make global changes to environment variables in Linux/Unix
> from inside C programs? I want this modified value to be available to
> independent scripts/processes. I figured, sentenv()/putenv() don't
> change the values of the environment variables permanently. So by what
> other way can I achieve this? Any suggestion will be highly
> appreciated.



Read the comp.unix.questions FAQ, which has a long section addressing
this issue. The short answer: there's no general way.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com