RFR: 7902970: Script build.sh will fail if the default shell is dash [v2]

Jonathan Gibbons jjg at openjdk.java.net
Tue Jul 13 18:40:18 UTC 2021


On Thu, 8 Jul 2021 04:47:21 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
>
> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revise the README according to the review comment

Hmmm, I didn't mean to close the PR; I was trying to mark a conversation as Resolved.

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

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


More information about the jtreg-dev mailing list