Bug 495772 - "source" broken in sh
Summary: "source" broken in sh
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Roman Rakus
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F11Blocker, F11FinalBlocker
TreeView+ depends on / blocked
 
Reported: 2009-04-14 18:01 UTC by Behdad Esfahbod
Modified: 2014-01-13 00:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-15 21:44:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


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