Re: system(const char *string) and environment variables
Re: system(const char *string) and environment variables
- Subject: Re: system(const char *string) and environment variables
- From: David Gohara <email@hidden>
- Date: Thu, 20 Jul 2006 11:22:11 -0500
On Jul 20, 2006, at 11:17 AM, Richard Cook wrote:
I believe the child inherits the paren't environment, so have you
tried putenv() (see man page)?
Yes. This is correct.
As Rich suggests, your application will by default inherit
environment settings from the parent environment. If you wish to add
environment settings to the currently running programs environment
you can use putenv as Rich suggested or the others like setenv etc...
(in terminal: man 3 putenv). The variables you set with your
application using these methods will only be valid for the execution
time of the application.
Once it quits, you'll be back in the parent environment.
Regards,
Dave
On Jul 20, 2006, at 8:42 AM, Filippo Ignozza wrote:
dear sirs,
from my own executable i am running a child executable using the
system(const char *string)
but i need that the child process has some enviroment variables
already
setted.
is there a way to achieve that?
it is ok for me both to set the variables for all the new opened
shells, as
well as to use some C code and modify the child executable so that it
sets the variables, reading from an external file.
regards
Ignozza Filippo
Digital Video S.p.a.
Tel +39 06 43599369
+39 06 4393578
Fax +39 06 43251588
E-mail email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/
mailman/options/x11-users/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/
mailman/options/x11-users/email@hidden
This email sent to email@hidden
David W. Gohara, Ph.D.
Center for Computational Biology
Washington University School of Medicine
http://www.sbgrid.org
http://www.macresearch.org
314-362-2934 (phone)
617-216-8616 (cell)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden