X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Fri, 21 Nov 2008 10:52:19 -0500 From: "Mark J. Reed" To: cygwin AT cygwin DOT com Subject: Re: Problem with aliases in bash as login shell In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <574BF80562AF37419EA4B003C90D756D06E28550 AT EXCHANGE1 DOT belgium DOT fhm DOT de> <20081121151308 DOT GA23561 AT ednor DOT casa DOT cgf DOT cx> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Fri, Nov 21, 2008 at 10:24 AM, Ryan Stewart wrote: > A nearly 4900 line man page is not exactly "direct". That was the > first place I looked. It was also the last place I looked, but even > knowing more or less what I was looking for, I couldn't find it. Can > you point me to a line number in the man page? To be fair, you have to do a lot of reading to learn the necessary concepts; there's not really a simple statement you can search for. Start with the section "COMMAND EXECUTION ENVIRONMENT", which is at line 1665 on my system (but I'm not using Cygwin ATM). "The shell has an execution environment, which consists of [...] shell aliases defined with alias [...] When a simple command other than a builtin or shell function is executed, it is invoked in a separate execution environment [...] A command invoked in this separate environment cannot affect the shell's execution envrionment". So basically, any command you run gets its own copy of the shell environment and can't change anything. Environment variables, aliases, current working dir, etc. There is no way to have the DOS effect of running a batch file and finding your command prompt in a different directory at the end of it (a nasty surprise for someone coming the other way from UNIX to DOS for the first time!) You can run .bash_profile all you want, but every time you're starting a new copy of the shell that gets thrown away when it hits the end of the file. So far, it sounds like you're out of luck, but the other piece of info is in the description of the "source" built-in (line 2681 for me): "source filename [arguments] Read and execute commands from filename *in the current shell environment* " (emphasis mine). Now, the "." command is a synonym for "source" - it's what the "source" command was called in the original UNIX shell, probably because it was most often used with files whose names start with ".". It's the more common way to load a file into the current envionment, but source is probably the easier command to find in the doc and would have worked as well. -- Mark J. Reed -- 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/