bug-bash
[Top][All Lists]
Advanced

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

Re: source command differs if in bash or sh mode


From: Chet Ramey
Subject: Re: source command differs if in bash or sh mode
Date: Sat, 04 Jul 2009 22:34:26 -0400
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

Gerhard Brauer wrote:

> Bash Version: 4.0
> Patch Level: 24
> Release Status: release
> 
> Could you CC me please as I'm not on the list. Thanks.
> And sorry for bad english...
> 
> Description:
>         If i source a file relative to the current directory then - if
> in sh mode - sourcing fails with file not found. If i source a file with
> absolute or relative path than it works in sh mode. In bash mode i have
> no problem.

This is a property of bash posix mode when you don't have `.' in $PATH:

 28. The `.' and `source' builtins do not search the current directory
     for the filename argument if it is not found by searching `PATH'.

> This behavior is new in version 4, old version 3.2 works fine.

The bash-3.2 behavior was a bug.  Its fix is listed in CHANGES:

ggg. Fixed a bug that caused a shell running in Posix mode to search $PWD for
     a file specified as an argument to source/. when the file was not found
     in $PATH.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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