Bug 10446 - Cannot source file in current directory in Busybox 1.27.2
Summary: Cannot source file in current directory in Busybox 1.27.2
Status: RESOLVED INVALID
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.27.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-23 05:51 UTC by Daniël de Kok
Modified: 2017-10-27 14:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Busybox config file (Arch Linux) (26.71 KB, text/plain)
2017-10-23 05:51 UTC, Daniël de Kok
Details

Note You need to log in before you can comment on or make changes to this bug.
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.