Hi All,

My query is related to assinging a variable with value which is there in the env.

Suppose from my c++ code i am doing putenv("A=abc"), now wat i want to do is to get this value of A in my shell script and assisng this "abc" to my shell variable, any idea how can i achieve this.

Thansk in advance.

Assuming you're running the c++ code from within a script, so that the ENV stays the same, you can just do

export SHELL=$A

if that's a misunderstanding, you can do this

export var=$A

Hopefully, I understood what you meant :)

, Mike

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.