bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BASH bug or expected behaviour?


From: Chet Ramey
Subject: Re: BASH bug or expected behaviour?
Date: Thu, 18 Aug 2005 13:26:45 -0400
User-agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716)

Dean K. Gibson wrote:
> In GNU Bash-2.05b (Fedora Core 1), I observe the following behaviour:
> 
> If bash script A is invoked (via "source") with command line parameters,
> and bash script A invokes (via "source") bash script B with NO
> parameters specified, then the parameters specified for A are passed to
> B (rather than what I would have thought would be the expected
> behaviour, that script B is called with NO parameters).

It's expected behavior.  `.' works just as if all of the commands
in the file were directly executed by the calling shell, which means
that everything is inherited, including the positional parameters.

It's a bash extension that allows additional arguments to `.' to be
temporarily treated as positional parameters.  The behavior with no
additional arguments is backwards compatible.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]