0

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

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Ancient Dragon
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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.