From owner-freebsd-questions@FreeBSD.ORG Mon Mar 1 19:42:37 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AA0016A4CE for ; Mon, 1 Mar 2004 19:42:37 -0800 (PST) Received: from lakemtao06.cox.net (lakemtao06.cox.net [68.1.17.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B34E43D31 for ; Mon, 1 Mar 2004 19:42:37 -0800 (PST) (envelope-from jlh@cox.net) Received: from gato ([68.99.4.61]) by lakemtao06.cox.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with SMTP id <20040302034234.JOKR20509.lakemtao06.cox.net@gato> for ; Mon, 1 Mar 2004 22:42:34 -0500 Message-ID: <0e2f01c40008$683727c0$6702a8c0@gato> From: "Jeff Hinrichs" To: References: <20040229192222.A7D0816A4EC@hub.freebsd.org><20040229180148.B693.GERARD-SEIBERT@rcn.com> <4042F370.40502@circlesquared.com> Date: Mon, 1 Mar 2004 21:42:36 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: Re: Search Path in Bash X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2004 03:42:37 -0000 ----- Original Message ----- From: "Peter Risdon" To: Cc: Sent: Monday, March 01, 2004 2:25 AM Subject: Re: Search Path in Bash > Gerard Seibert wrote: > > >Peter Risdon writes: > > > > > >>When bash is invoked as an interactive login shell, or as a non-inter- > >> active shell with the --login option, it first reads and > >>executes com- > >> mands from the file /etc/profile, if that file exists. After > >>reading > >> that file, it looks for ~/.bash_profile, ~/.bash_login, and > >>~/.profile, > >> in that order, and reads and executes commands from the first > >>one that > >> exists and is readable. The --noprofile option may be used > >>when the > >> shell is started to inhibit this behavior. > >> > >> > >> > >> > > > >********** Reply Separator ********** > >Sunday, February 29, 2004 6:01:48 PM > > > >Peter, you stated the following: > > > >When bash is invoked as an interactive login shell, or as a non-inter-active > >shell with the --login option, it first reads and executes commands > >from the file /etc/profile, if that file exists. After reading that > >file, it looks for ~/.bash_profile, ~/.bash_login, and >~/.profile, in > >that order, and reads and executes commands from the first one that > >exists and is readable > > > > > The credit has been lost along the way, but I was quoting the man page. > > >If I am following you correctly, then having a ~/,bashrc, ~/.bashrc or > >~/.profile file is worthless, if bash reads only the first file that it > >finds. I am referring in this scenario to the ~/.bash_profile file. > > On systems that I have used, I have seen the following: ~/.bash_profile which then executes ~/.bashrc when then executes /etc/bashrc the logic being that: # Personal envrionment variables and startup programs go in ~/.bash_profile # Personal aliases and functions should go in ~/.bashrc. . # System wide aliases and functions are in /etc/bashrc. # System wide environment variables and startup programs are in /etc/profile funny thing is that I was just researching that topic today. Now, if someone sees a glaring problem with the above information please feel free to let me in on it. -Jeff