943,518 Members | Top Members by Rank

Ad:
Nov 27th, 2007
0

Regarding Env variables

Expand Post »
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.
Similar Threads
Reputation Points: 25
Solved Threads: 0
Light Poster
RohitSahni is offline Offline
35 posts
since Jul 2007
Nov 28th, 2007
0

Re: Regarding Env variables

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
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007

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 Shell Scripting Forum Timeline: reverse with cut command
Next Thread in Shell Scripting Forum Timeline: parsiring asterisk





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


Follow us on Twitter


© 2011 DaniWeb® LLC