Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
To: "Jean-Paul de Gier" <j.de.gier@industrious.nl>
Cc: <cygwin@cygwin.com>
Subject: Re: bash: bug in parameter passing
References: <018e01c0dd35$c02836c0$794988d4@riih223>
Cc: Karel Sprenger <karel.sprenger@compaq.com>
Organization: Compaq Computer Corporation
X-Public-Key: http://pgp5.ai.mit.edu:11371/pks/lookup?op=get&search=0xA4846394
From: Karel Sprenger <karel.sprenger@compaq.com>
Date: 15 May 2001 17:03:51 +0200
In-Reply-To: <018e01c0dd35$c02836c0$794988d4@riih223>
Message-ID: <upudairhk.fsf@compaq.com>
Lines: 45
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Hi,

>>> On Tue, 15 May 2001 13:48:17 +0200, Jean-Paul de Gier (Jean-Paul)
>>> wrote:
Jean-Paul> 
Jean-Paul> Hi,
Jean-Paul> Consider the following script:
Jean-Paul> 
Jean-Paul> #test 
Jean-Paul> echo parameter $1
Jean-Paul> 
Jean-Paul> which is called by this script:
Jean-Paul> 
Jean-Paul> # testparam
Jean-Paul> echo testparam $1
Jean-Paul>   test param1
Jean-Paul> 
Jean-Paul> Notice the dot in front of the call of script test.
Jean-Paul> If you run the last script, say testparam 123
Jean-Paul> then you will see:
Jean-Paul> testparam 123
Jean-Paul> parameter 123
Jean-Paul> 
Jean-Paul> instead of:
Jean-Paul> testparam 123
Jean-Paul> parameter param1
Jean-Paul> 
Jean-Paul> I would say that this is a bug.
Jean-Paul> 

With Bash 2.05.0(6) I get the expected rather than the erroneous
result.  However I had to change the third line of script testparam to
read ". ./test" else bash would complain it couldn't find
/usr/bin/test.

Cheers,
Karel

-- 
Karel Sprenger, senior solution specialist
COMPAQ, Professional Services
Phone:  +31 (30) 283 4542           Private: +31 (20) 670 0942
E-mail: karel.sprenger@compaq.com   Private: cjas@xs4all.nl
"Memory fault -- core...uh...um...core... Oh dammit, I forget!"



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

