Date: Mon, 1 Mar 2004 21:42:36 -0600 From: "Jeff Hinrichs" <jlh@cox.net> To: <freebsd-questions@freebsd.org> Subject: Re: Search Path in Bash Message-ID: <0e2f01c40008$683727c0$6702a8c0@gato> References: <20040229192222.A7D0816A4EC@hub.freebsd.org><20040229180148.B693.GERARD-SEIBERT@rcn.com> <4042F370.40502@circlesquared.com>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- From: "Peter Risdon" <peter@circlesquared.com> To: <gerard-seibert@rcn.com> Cc: <freebsd-questions@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0e2f01c40008$683727c0$6702a8c0>