![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| environment variables | radhika03 | Shell Programming and Scripting | 3 | 01-22-2007 01:58 PM |
| help..Environment variables... | sekar sundaram | UNIX for Dummies Questions & Answers | 3 | 08-30-2005 03:35 AM |
| environment variables | spavlov | UNIX for Dummies Questions & Answers | 3 | 08-20-2003 09:49 AM |
| environment variables | Esaia | High Level Programming | 2 | 02-20-2003 08:19 PM |
| what is the use of Environment variables | indianguru | UNIX for Dummies Questions & Answers | 2 | 07-24-2001 09:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
environment variables
hi,
I want to create a new EV(Environment Variable) through a c program and I done this thing through setenv() method. But the newly created EV is not permanent, i.e. when I exit from the program the EV also no longer lives. But I want to make it a permanent EV for the current user. Actually I am getting all the environment variables through envp (the environment variable pointer, it is the list of all the EVs). thanks & regards sumsin. |
|
||||
|
It is not possible to create an environment variable in a child proces (what you are in when you are running code) and have the parent shell be able to see it. Once the code exits, the variable is gone with the defunct process.
|
|
||||
|
but what I am thinking that ... I write these variables in one of my private file say ".myprogram_profile" at $HOME dir, then source this private file in .bash_profile so that the newly created variables comes in effect.
am i right? or i should think some other approach. what do u say? thanks & regards sumsin |
|
||||
|
Quote:
though the variables are available they are in effect only to the child(running process which created the EV variables) and not in effect to the parent ( shell ) which forked by the child. Wont the newly added Env variables be effected with respect to the parent only after running the .profile ----> .$HOME/.profile? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|