Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7902970

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • generic
    • generic

      When the local default shell is `dash`, the command script make/build.sh will fail with the following error messages.

      ```
      $ 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
      ```

      It is because my local `sh` command links to the `dash`. And the `dash` doesn't support the variables such as `BASH_SOURCE`.

      ```
      $ 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
      ```

      It is good to state this situation in the documentation.

            gli Guoxiong Li
            gli Guoxiong Li
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: