Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Thu, 20 Nov 2003 11:14:53 -0500 (EST)
From: Wirawan Purwanto <wirawan@camelot.physics.wm.edu>
X-X-Sender: wirawan@wirawan0.lan
To: cygwin@cygwin.com
Subject: Re: Problem with noninteractive bash initialization
In-Reply-To: <Pine.GSO.4.56.0311191610560.12731@slinky.cs.nyu.edu>
Message-ID: <Pine.LNX.4.50.0311201101580.9948-100000@wirawan0.lan>
References: <Pine.LNX.4.50.0311191531400.3163-100000@wirawan0.lan>
 <Pine.GSO.4.56.0311191610560.12731@slinky.cs.nyu.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 19 Nov 2003, Igor Pechtchanski wrote:

> Don't know, WFM:
> 
> $ echo '#!/bin/bash
> echo "Hellow"' > xyz
> $ bash -x xyz
> + echo Hellow
> Hellow
> $ bash --version
> GNU bash, version 2.05b.0(1)-release (i686-pc-cygwin)
> Copyright (C) 2002 Free Software Foundation, Inc.
> $
> 
> BTW, the #! line is redundant if you invoke the script this way -- bash
> (the one you invoked on the command line) simply interprets the commands
> in it, and #! is ignored.
> 	Igor
> 

Do you have a ~/.bashrc file? Or is it empty?

BTW I also noticed the same strange behavior on several other versions of 
cygwin. Notably,

On Linux Mandrake release 7.2 (Odyssey) for i586:
	GNU bash, version 2.04.12(1)-release (i586-mandrake-linux-gnu)
	Copyright 1999 Free Software Foundation, Inc.

On Red Hat Linux release 7.1 (Seawolf) for alpha:
	GNU bash, version 2.04.21(1)-release (alpha-redhat-linux-gnu)
	Copyright 1999 Free Software Foundation, Inc.

<... wandering some more ...>

....WHOOPS. Okay! I found the culprit. That's the BASH_ENV environment
variable! If it is set, the file whose name given by that variable will be
READ and executed BEFORE the actual script is invoked.

Thanks guys for the help!

Wirawan


--
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/

