LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-11-2004, 10:59 AM   #1
jbrashear
Member
 
Registered: Aug 2003
Posts: 33

Rep: Reputation: 15
/etc/profile vs. /etc/bash.bashrc


I need to set some system wide environment variables (i.e., JAVA_HOME, etc) and was wondering if it is more appropriate to set them in:

/etc/profile (where I have them now)

vs.

/etc/bash.bashrc

or.

neither???

Thanks!
 
Old 03-11-2004, 12:36 PM   #2
liquigel
Newbie
 
Registered: Feb 2004
Location: CT, USA
Distribution: Debian stable
Posts: 29

Rep: Reputation: 15
I believe that environment variables get set in a login shell script (/etc/profile or ~/.bash_profile) rather than one that gets executed for each terminal session (/etc/bash.bashrc or ~/.bashrc).
 
Old 03-11-2004, 02:32 PM   #3
jbrashear
Member
 
Registered: Aug 2003
Posts: 33

Original Poster
Rep: Reputation: 15
Hmm...

Quote:
Originally posted by liquigel
I believe that environment variables get set in a login shell script (/etc/profile or ~/.bash_profile) rather than one that gets executed for each terminal session (/etc/bash.bashrc or ~/.bashrc).
I do want the variables set for each terminal session, so /ect/profile seems to do the trick. Just wondering if that is standard pratice..?

Last edited by jbrashear; 03-11-2004 at 02:36 PM.
 
Old 03-11-2004, 04:49 PM   #4
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
{ Note: liquigel ==> johnMG }

Sorry if I was unclear jbrashear. What I was getting at was: since environment variables are passed on to subshells, I figured that you generally set up environment variables in either /etc/profile (for system-wide environment variables), or in ~/.bash_profile (for a given user's environment variables).

I think it's conventional to use /etc/bash.bashrc and ~/.bashrc for stuff like aliases, which do *not* get passed on to subshells.

It would be nice if the ones located in /etc had some commenting in them describing this.
 
  


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
/etc/profile V.S. /etc/bashrc Takayuki Linux - General 12 05-18-2011 12:25 AM
/etc/profile vs /etc/bashrc maybbach Linux - Newbie 6 04-22-2005 10:50 AM
RH9 bashrc and profile magnusprime Red Hat 5 09-01-2003 06:32 PM
Where's my .bashrc or .profile t1mc00per Linux - Software 6 03-03-2003 11:35 AM
.bashrc,profile.local Cichlid Linux - Distributions 1 01-08-2002 06:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:39 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
Open Source Consulting | Domain Registration