954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Regarding Env variables.

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

RohitSahni
Light Poster
35 posts since Jul 2007
Reputation Points: 25
Solved Threads: 0
 

>> 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.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You