Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environment Variables in execve()

Status
Not open for further replies.

dbraunc

Technical User
Oct 15, 2002
5
0
0
DE
How can set one Env-Variable (e.g. LD_LIBRARY_PATH) to multiple Paths ? I want to set two different Paths in that Variable (but I don't know how to separate the two paths !).
Then I want to call the execve-function with this environment.
Can anyone help me ?
 
AFAIK, you can set environment variables to more than one value. It can be done by separating the values by a comma. So in LD_LIBRARY_PATH it would look like this:

Code:
LD_LIBRARY_PATH=/usr/lib;/usr/local/lib

Then in execve():

Code:
execve("/usr/local/bin/something","-f","LD_LIBRARY_PATH=/usr/lib;/usr/local/lib");

Haven't tested this yet but it is worth a try.

Hope this helps! [thumbsup]
Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.

- janvier -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top