944,055 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1364
  • C++ RSS
Nov 5th, 2007
0

Regarding Env variables.

Expand Post »
I am calling one c++ exe from my unix shell script, i am trying to set the env variables using putenv() thru my c++ code. Now i want to use these varibles in my new exe which is there in the same shell script(set by using the previous exe ) , but i am not able to access those varibles..

Please help me out in this.


flow of the script. :

one c++ exe (putenv("ABC=a") variable)
|
(when i am doing echo $ABC in the script i am not able to get its value and also i am not able to getenv this variable value)
|
V
second c++ exe of different version compiler (Here i want to get the already set env variables.)



I am not able to do that
Similar Threads
Reputation Points: 25
Solved Threads: 0
Light Poster
RohitSahni is offline Offline
35 posts
since Jul 2007
Nov 5th, 2007
0

Re: Regarding Env variables.

>> am not able to do that
Yup -- you found out the hard way that it can't be done. One solution is to write the variables to a file or shared memory so that other programs can read them.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,954 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Help with mfc classes pleeeease
Next Thread in C++ Forum Timeline: deleting dynamic memory





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC