Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 12-07-2006, 01:15 PM   #1
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
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,053
Blog Entries: 14

Rep: Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226
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
Registered: Jan 2006
Posts: 65

Original Poster
Rep: Reputation: 15

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


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 > Forums > Linux Forums > Linux - Software

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

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