Jan 29, 2009

Updating the profile file in /etc folder with new environment variable values

If I am not administrator then some ENVIRONMENT VARIABLES path values that I changed will not remain intact after I restart my computer. So Here is procedure to save it so that each time I restart computer I don't have to set the ENVIRONMENT VARIABLES in command prompt.
Suppose I am setting the path variable MAGICK_HOME for image magick API.

export MAGICK_HOME="/Users/reza/Desktop/Image-Magick-6.4.8" // location in my computer :)
export PATH="$MAGICK_HOME/bin:$PATH"
export LD_LIBRARY_PATH="$MAGICK_HOME/lib"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"

Now, go to the folder /etc. It contains a file named profile.
Open it with vi.

command:

vi profile

Then paste the above code and save it.
After saving in the profile file then path variables will retain the values inserted.

No comments:

Down with the Dictatorship!

    "Let them hate me, so that they fear me" - Caligula 41AD