[PATCH] ash: make bash_source command search current directory after PATH

Mike Frysinger vapier at gentoo.org
Fri Jan 26 18:50:02 UTC 2018


On 26 Jan 2018 15:15, Denys Vlasenko wrote:
> On Fri, Jan 26, 2018 at 9:34 AM, Paul Otto <paul at ottoops.com> wrote:
> > This patch restores, and improves upon, expected behavior to BASH
> > compatibility which was lost beginning with 1.27.0. This was pulled into
> > Alpine 3.7 which, in turn was pulled into official Docker images beginning
> > with docker:17.12. As a result, a large number of CICD builds that use
> > "source filename" have broken everywhere.
> >
> > According to the BASH documentation, the source command should:
> > 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, filenames  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.
> 
> I wish bash wouldn't introduce gratuitous standard violations.

bash is its own shell.  why can't it introduce its own extensions as it sees
fit ?  if you want a runtime that doesn't violate POSIX standards, you can
already get that with `set -o posix` (among other ways).  but it won't turn
off bash extensions that don't clash with the standard ...

if the bash-specific behavior wasn't useful, then people wouldn't request
support for them right ? :)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20180126/4758f05b/attachment.asc>


More information about the busybox mailing list