Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147102 - In bash, sourcing a filename searches $PATH before searching the current directory.
Summary: In bash, sourcing a filename searches $PATH before searching the current dire...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Lowest minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 147104 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-10 14:19 UTC by dan zwell
Modified: 2006-09-10 14:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dan zwell 2006-09-10 14:19:34 UTC
Using bash, version 3.1.16(1)-release (x86_64-pc-linux-gnu), typing "source somefile" or ". somefile" looks for "somefile" in $PATH before searching for files in the current directory. For example, in a directory with an empty file called "vim", typing ". vim" prints (to stderr): "bash: ELF: command not found", which is the result I would get from typing "source `which vim`".

Obviously, bash should just source the (empty) file and give no output. Typing ". ./vim" behaves as expected. I noticed this behavior on a system with bash completion installed and in use, but I have tested it after commenting out my /etc/profile file and removing ~/.bashrc.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-10 14:36:09 UTC
*** Bug 147104 has been marked as a duplicate of this bug. ***
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-09-10 14:47:39 UTC
man bash
/source

<snip>
If filename does not contain a slash, file names in PATH are used to find the directory containing filename. The file searched for in PATH need not be executable. When bash is not in posix mode, the current directory is searched if no file is found in PATH. If the sourcepath option to the shopt
builtin command is turned off, the PATH is not searched.
</snip>