Sunday, April 28, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 7042  / 1 Year ago, mon, november 28, 2022, 7:01:30

I'm running Ubuntu 12.04



I added



export LD_LIBRARY_PATH=/home/dspies/workspace/hdf5-1.8.11-linux-shared/lib


to .profile



but when I log in and open terminal and put echo $LD_LIBRARY_PATH there's nothing.



When I switch to ctrl-alt-F1 and log in, echo $LD_LIBRARY_PATH
gives



/home/dspies/workspace/hdf5-1.8.11-linux-shared/lib


but then when I run screen, echo $LD_LIBRARY_PATH from within screen is empty again



In what circumstances can I expect environment variables from .profile to be set? (interestingly, it seems any modifications to PATH made in .profile always show up)



EDIT: Sorry, I guess I didn't clarify what I really wanted to know which is:
How can I set an environment variable that I mean to be set anywhere (ie in screen, in terminal, when I log-in, and when I ssh in)?


More From » command-line

 Answers
0

The answer is:



I should set them in .pam_enviornment



See here https://help.ubuntu.com/community/EnvironmentVariables



I imagine this is one of the most common questions, I don't know why nobody gave me the proper answer when I asked this question.


[#31104] Monday, November 28, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allowiel

Total Points: 189
Total Questions: 103
Total Answers: 105

Location: Slovenia
Member since Thu, Mar 18, 2021
3 Years ago
;