X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4A2D9947.1080606@aim.com> Date: Mon, 08 Jun 2009 19:05:43 -0400 From: Mark Harig User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: cygwin AT cygwin DOT com CC: lennart DOT borgman AT gmail DOT com Subject: Re: Bug in $PATH initialization? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AOL-IP: 205.188.169.200 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From the bash manual (in emacs: M-: (info "(bash) Bash Startup Files")): "When Bash is invoked as an interactive login shell, or as a non-interactive 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 `--noprofile' option may be used when the shell is started to inhibit this behavior." and "When an interactive shell that is not a login shell is started, Bash reads and executes commands from `~/.bashrc', if that file exists. This may be inhibited by using the `--norc' option." So, in the typical case, when you start bash with '-i', it sources the following files: /etc/profile # which typically contains PATH initialization ~/.bash_profile # or some other "login" file, such as ~/.profile ~/.bash_profile will usually source ~/.bashrc (the non-login code) To avoid having these files read, start bash with '--noprofile' (if you wish to avoid reading /etc/profile and ~/.bash_profile) and '--norc' (if you wish to avoid reading ~/.bashrc. Or, simply edit /etc/profile and ~/.bashrc, where PATH is typically set to get PATH to have the ordering that you want. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/