Bug 495772

Summary: "source" broken in sh
Product: [Fedora] Fedora Reporter: Behdad Esfahbod <behdad>
Component: bashAssignee: Roman Rakus <rrakus>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: rrakus, tcallawa, tsmetana, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-15 21:44:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 446452    

Description Behdad Esfahbod 2009-04-14 18:01:04 UTC
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):

bash-4.0-6.fc11.i586


How reproducible:

Fully reproducible

Steps to Reproduce:

1. Create a file called x.sh with the following two lines:
===========
#!/bin/sh
echo Hello
===========

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

$ source x.sh
Hello

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
x.sh

Comment 1 Behdad Esfahbod 2009-04-15 21:27:51 UTC
Ping?  This is failing rebuild of preload in rawhide.
I think this should be a F11 blocker.

Comment 2 Behdad Esfahbod 2009-04-15 21:43:31 UTC
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