Integrated: 7902970: Script build.sh will fail if the default shell is dash

Guoxiong Li gli at openjdk.java.net
Wed Jul 14 03:02:18 UTC 2021


On Sat, 12 Jun 2021 15:05:49 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> My local default shell is `dash`.
> 
> 
> $ ls -al /bin/*sh*
> -rwxr-xr-x 1 root root 1113504 Jun 7 2019 /bin/bash
> -rwxr-xr-x 1 root root 121432 Jan 25 2018 /bin/dash
> lrwxrwxrwx 1 root root 4 Sep 26 2020 /bin/rbash -> bash
> lrwxrwxrwx 1 root root 4 Sep 26 2020 /bin/sh -> dash
> lrwxrwxrwx 1 root root 4 Sep 26 2020 /bin/sh.distrib -> dash
> lrwxrwxrwx 1 root root 7 Sep 18 2020 /bin/static-sh -> busybox
> 
> 
> When I use the command `sh make/build.sh --help`, the build.sh will fail.
> Because the `dash` doesn't support the variables such as `BASH_SOURCE`.
> 
> 
> $ sh make/build.sh --help
> make/build.sh: 252: make/build.sh: Bad substitution
> make/build.sh: 253: make/build.sh: Bad substitution
> make/build.sh: 254: .: Can't open /build-support/build-common.sh
> 
> 
> The successful command is `bash make/build.sh --help`, which uses `bash` explicitly
> instead of the default shell `sh` implicitly.
> 
> This patch clarifies this situation in the README.
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

This pull request has now been integrated.

Changeset: d7d07ef3
Author:    Guoxiong Li <gli at openjdk.org>
Committer: Jonathan Gibbons <jjg at openjdk.org>
URL:       https://git.openjdk.java.net/jtreg/commit/d7d07ef3d517b2d26469e846de747d2bd245a900
Stats:     4 lines in 1 file changed: 4 ins; 0 del; 0 mod

7902970: Script build.sh will fail if the default shell is dash

Reviewed-by: jjg

-------------

PR: https://git.openjdk.java.net/jtreg/pull/12


More information about the jtreg-dev mailing list