From owner-freebsd-questions@FreeBSD.ORG Thu Jun 10 17:59:17 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 BE7E516A4D0 for ; Thu, 10 Jun 2004 17:59:17 +0000 (GMT) Received: from mtiwmhc11.worldnet.att.net (mtiwmhc11.worldnet.att.net [204.127.131.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DAF343D2F for ; Thu, 10 Jun 2004 17:59:17 +0000 (GMT) (envelope-from apv@capital.net) Received: from capital.net (alb-24-195-88-72.nycap.rr.com[24.195.88.72]) by worldnet.att.net (mtiwmhc11) with ESMTP id <20040610175859111009481he> (Authid: apvanderveen); Thu, 10 Jun 2004 17:58:59 +0000 Message-ID: <40C8A133.9020300@capital.net> Date: Thu, 10 Jun 2004 13:58:11 -0400 From: "Arend P. van der Veen" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040525 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Bash Startup Files 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: Thu, 10 Jun 2004 17:59:17 -0000 Hi, I have been trying to clarify what bash startup files are sourced and when. I am using bash-2.05b.007. I have been hunting around on the web and I have found the following summary: For Login shells: On logging in: If `|/etc/profile|' exists, then source it. If `|~/.bash_profile|' exists, then source it, else if `|~/.bash_login|' exists, then source it, else if `|~/.profile|' exists, then source it. On logging out: If `|~/.bash_logout|' exists, source it. For non-login interactive shells: On starting up: If `|~/.bashrc|' exists, then source it. For non-interactive shells: On starting up: If the environment variable |ENV| is non-null, expand the variable and source the file named by the value. If Bash is not started in Posix mode, it looks for |BASH_ENV| before |ENV|. (From http://www.cse.unsw.edu.au/help/doc/info/bash/Bash_Startup_Files.html) Other discussions on this topic essentially state the same thing. After some testing it is not clear to me if bash under FreeBSD 4.9 is working the same way. I have a case where both ~/.profile and ~/.bash_profile exist and both are sourced. This is in contradition to the above statements. Can anybody point me to information to clarify what bash startup files are sourced and when ? Thanks in advance, Arend van der Veen