From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: How to make emacs to run my ~/.bash_profile Date: Sun, 20 Sep 2009 11:45:42 +0200 Organization: Informatimago Message-ID: <87y6oac5kp.fsf@galatea.local> References: <5ff1d48c0909181624w301d5c0dh1f33fdd19dea02d1@mail.gmail.com> <87r5u28e2g.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253443272 18145 80.91.229.12 (20 Sep 2009 10:41:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Sep 2009 10:41:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 20 12:41:05 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MpJqq-0004yn-Hh for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Sep 2009 12:41:04 +0200 Original-Received: from localhost ([127.0.0.1]:50481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MpJqp-00023P-SW for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Sep 2009 06:41:03 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-X-Trace: individual.net ttsAkeUfX2s6NwkyLNc22wPMYrbByvWCl73B8iGasrpjFJjSTk Cancel-Lock: sha1:MDdlZTU2Y2Q3MWE1ZTMzZGJhM2M3MWY3Y2NlZmIxMmIxNjc4YWJmNg== sha1:ZeXwj0K4/3vA1K+R9B0Nyw3ESlk= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:173201 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68324 Archived-At: Tim X writes: > Wang Lei writes: > >> I think .bash_profile is only executed once, just after login. >> .bashrc is the actual executed file when starting a shell. > > Just to try and clarify.... > > The .bash_profile is only executed for a login shell. > The .bashrc is executed for every shell. > The idea is to put all the static environment settings in your > .bash_profile and dynamic settings that change depending on dynamic data > in the .bashrc. At a guess, I'd say this seperation was from the days > when computers were a lot slower and you worked hard to minimise the > work being done. As sub-shells inherit the environment of their parent > shell, there is no advantage in redefining static data every time a new > shell is executed. However, with GUI environments, often the do you load .bash_profile (and arguably with reason, since the Finder or GNOME are not bash. Some terminal emulator have an option to launch the shells as login shells, so they may load their login RC files. But not all do that, and not all users know to set this option. That's why my .bash_login is empty, and my .bash_profile contains only: [ -f ~/.bashrc ] && . ~/.bashrc and everything's in my '.bashrc'... -- __Pascal Bourguignon__