This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with noninteractive bash initialization


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]