Bug 10446

Summary: Cannot source file in current directory in Busybox 1.27.2
Product: Busybox Reporter: Daniël de Kok <me>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.27.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: Busybox config file (Arch Linux)

Description Daniël de Kok 2017-10-23 05:51:31 UTC
Created attachment 7316 [details]
Busybox config file (Arch Linux)

Sourcing a file from the current directory does not work anymore:

~ % busybox sh
# touch test.conf
# source test.conf
sh: source: test.conf: not found
# source ./test.conf
#

I use the default configuration of busybox in Arch Linux (attached).
Comment 1 Denys Vlasenko 2017-10-27 14:24:12 UTC
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

DESCRIPTION

    The shell shall execute commands from the file in the current environment.

    If file does not contain a <slash>, the shell shall use the search path specified by PATH to find the directory containing file. Unlike normal command search, however, the file searched for by the dot utility need not be executable.

****************

bash deviates from the above, but only in non-POSIX mode (i.e. if run as "bash"; if run as "sh", it won't try current dir).
Comment 2 Denys Vlasenko 2017-10-27 14:24:45 UTC
NAME

    dot - execute commands in the current environment

SYNOPSIS

    . file

DESCRIPTION

    The shell shall execute commands from the file in the current environment.

    If file does not contain a <slash>, the shell shall use the search path specified by PATH to find the directory containing file. Unlike normal command search, however, the file searched for by the dot utility need not be executable.