Re: F11: Bug in sh-4.0 source build-in command

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

 



Dario Lesca wrote:
> Il giorno lun, 03/08/2009 alle 20.55 +0200, Michal Schmidt ha scritto:
>> Not a bug. You're running bash in POSIX mode (probably you ran "sh").
>> In POSIX mode the current directory is not searched by the source
>> command. This is documented in the manpage.
> 
> IMHO, this is a Bug.
> 
> "source: usage: source filename [arguments]"
> 
> The command "source" take a "file" (-f, 644) and not a "executable" (-x,
> 755), like do "ls fil", "cat file", "sh file, "awk file", and many other
> command.
> 
> So, if I run "source file", source must use "file", like do other
> command.
> 
Well, source is a built-in command, so it  acts different if you are
using Bash in the sh (posix) mode instead of bash mode. So you may
need to give the full path to the file. From the bash man page:

source filename [arguments]
       Read and execute commands from filename in the current shell
       environment and return the exit status of the last command
       executed from filename. 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. If any arguments are supplied, they become
       the positional parameters when filename is executed.
       Otherwise the positional parameters are unchanged. The return
       status is the status of the last command exited within the
       script (0 if no commands are executed), and false if filename
       is not found or cannot be read.

So I don't think it is a bug, but a compatibility feature.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux