LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables) (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-set-ld_library_path-in-cshrc-able-to-set-other-env-variables-358172/)

senthilpr_in 08-29-2005 01:07 PM

Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables)
 
Hi all,

I' not able to set my LD_LIBRARY_PATH env variable in my .cshrc file. This is what I have tried .

----------------------------------------------------------------------------
...
...
setenv OIVHOME /home/oivhome
setenv LD_LIBRARY_PATH /home/oiv50/lib
setenv TESTVAR testvalue
...
...
----------------------------------------------------------------------------

The first line I have quoted was already present in my .cshrc file. LD_LIBRARY_PATH is not declared before, (atleast when I try echo $LD_LIBRARY_PATH in a shell, I get LD_LIBRARY_PATH: undefined variable).

I added the third line to see if I'm able to set any other variables, and after relogin I'm able to see that TESTVAR is set, but LD_LIBRARY_PATH is still not set.

My default shell is tcsh and I'm editing my .cshrc file. (Does that make a difference ) I tried changing my default shell to csh, still unable to set LD_LIBRARY_PATH.

Please advice
Senthil

pats 09-14-2005 08:06 AM

ok firstly when you've got a shell window open you can type

echo $0 to find out which shell your using

(personally i'd choose bash over anything because its just better)

it does matter which profile shell you edit because if you don't log into that particular shell then you won't initialise that env var. it is strange that the test var is being set but the library path isn't.

have you tried typing this in at the command line and not haivng it in the profile file and seeing if it works
setenv LD_LIBRARY_PATH /home/oiv50/lib
then do an echo $LD_LI....

senthilpr_in 09-14-2005 09:12 AM

Hi, Yes I'm able to set the env variable in command line. Unable to do so via .cshrc file, so that it is set everytime I login.
Thx for your reply
Senthil

linuxter 02-26-2007 11:25 AM

Cannot Set Ld_library_path
 
I have exactly the same problem, rest of the variables I set in /etc/profile are set fine execpt LD_LIBRARY_PATH (so far). I can set the variable in the shell after login. Is there something I am missing or is it a bug of some sort?
plese let me know, thanks

linuxter 02-26-2007 12:46 PM

OK it is some security issue. If you set it in either /etc/bashrc or $HOME/.bashrc it will work. Search for the explain:
Refer to the comment by sperlis in "Problem exporting LD_LIBRARY_PATH" thread.


All times are GMT -5. The time now is 11:26 PM.