| | |
Regarding Env variables
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
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
export SHELL=$A
if that's a misunderstanding, you can do this
export var=$A
Hopefully, I understood what you meant

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
![]() |
Similar Threads
- multiple variables in a mod_rewrite URL string (Linux Servers and Apache)
- Regarding Env variables. (C++)
- How to access the system environment variables in windows (Perl)
- Problem with variables in Windows shell script (Windows NT / 2000 / XP)
- Problem Unsetting Variables? (PHP)
- Launching an application from a thread (C++)
- More newbie problems - VBScript and Env variables (Visual Basic 4 / 5 / 6)
Other Threads in the Shell Scripting Forum
- Previous Thread: reverse with cut command
- Next Thread: parsiring asterisk
| Thread Tools | Search this Thread |





