Bug 495772 - "source" broken in sh
"source" broken in sh
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Roman Rakus
Fedora Extras Quality Assurance
Depends On:
Blocks: F11Blocker/F11FinalBlocker
  Show dependency treegraph
Reported: 2009-04-14 14:01 EDT by Behdad Esfahbod
Modified: 2014-01-12 19:08 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-15 17:44:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Behdad Esfahbod 2009-04-14 14:01:04 EDT
Description of problem:

The "source" builtin (as well as ".") seems to be broken and fails to find files in sh mode.

Version-Release number of selected component (if applicable):


How reproducible:

Fully reproducible

Steps to Reproduce:

1. Create a file called x.sh with the following two lines:
echo Hello

2. Observe that with bash, the following command works:

$ source x.sh

3. Run sh, and try again:

sh-4.0$ source x.sh
sh: source: x.sh: file not found

But the file is right there:

sh-4.0$ ls x.sh
Comment 1 Behdad Esfahbod 2009-04-15 17:27:51 EDT
Ping?  This is failing rebuild of preload in rawhide.
I think this should be a F11 blocker.
Comment 2 Behdad Esfahbod 2009-04-15 17:43:31 EDT
Ok, seems like bash 4's manual explains the behavior:

     Read and execute commands from the FILENAME argument in the
     current shell context.  If FILENAME does not contain a slash, the
     `PATH' variable is used to find FILENAME.  When Bash is not in
     POSIX mode, the current directory is searched if FILENAME is not
     found in `$PATH'.  If any ARGUMENTS are supplied, they become the

Note You need to log in before you can comment on or make changes to this bug.