PDA

View Full Version : setting environment variables



craigni
25th December 2006, 03:54 PM
I have a very strange problem with FC5 setting global and local environment variables.

To set a global environment variable, I put this as a file ("ldlibpath.sh") in /etc/profile.d:

# Set LD_LIBRARY_PATH
if [ -z "$LD_LIBRARY_PATH" ] ; then
LD_LIBRARY_PATH="/usr/local/lib" ; else
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" ; fi
export LD_LIBRARY_PATH

I then added this line to my .bash_profile:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$HOME/geda-install/lib

On startup (both Gnome and KDE)

$ echo $LD_LIBRARY_PATH
/usr/local/lib

*only*. If I source .bash_profile in my home directory,

$ source .bash_profile
$ echo $LD_LIBRARY_PATH
/usr/local/lib:/usr/local/lib:/home/myhome/geda-install/lib

For the longest time, I thought this was a sourcing problem--that .bash_profile in my home directory wasn't being sourced. But then I put the line

export MONKEY=monkeyman

into .bash_profile, and when I echo $MONKEY I get monkeyman on startup. So it seems that the export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$HOME/geda-install/lib in my .bash_profile isn't being run *selectively*. Weird!!

Anybody have any ideas what is going on, and how I can add /home/myhome/geda-install/lib to my LD_LIBRARY_PATH for just my local login???

Many TIA
Craig