LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-07-2006, 01:15 PM   #1
laggerific
Member
 
Registered: Jan 2006
Posts: 65

Rep: Reputation: 15
Question Is it possible to locate where an environmental variable is exported from?


Is there a way to check? Is there an order of precidence as to what will have the final say on what an environmental variable will be?
 
Old 12-07-2006, 01:46 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Order is /etc/profile and/or /etc/bashrc (global for all users) then $HOME/.profile and/or $HOME/.bashrc.

Of course each of these can source in other files that set variables. I worked on a system once where tracing it down once where when I was all done I found 5 levels of sourcing occuring because the .profile sourced a script which in turned sourced another which in turn source another and so on.

One way to figure it out might by adding a "-x" for debug to your .profile or .bashrc (you can try the /etc files but if anyone else logs in while you're testing they're going to be mighty confused by what they see).
 
Old 12-07-2006, 01:55 PM   #3
laggerific
Member
 
Registered: Jan 2006
Posts: 65

Original Poster
Rep: Reputation: 15
Smile

Ah yes...there was some sourcing in there...thankfully not too deep, but that takes care of that...thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how PKG_CONFIG_PATH environmental variable set these package hitlar Linux - Software 1 06-20-2006 11:46 PM
Setting an environmental variable maevious Linux - Newbie 6 11-24-2005 05:15 PM
nohup tcsh (environmental variable) podollb Linux - Software 0 05-17-2004 06:44 PM
setting environmental variable cc to a working compiler blathen Linux - Newbie 2 10-27-2003 01:30 AM
how to get environmental variable from JAVA program edreddy Programming 2 07-29-2002 11:38 AM


All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration