www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21059] New: install.sh: posix_terminal returns false on Linux


          Issue ID: 21059
           Summary: install.sh: posix_terminal returns false on Linux Mint
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: john.michael.hall gmail.com

As originally discussed at 
https://forum.dlang.org/post/jvslnzlphrvjffixymys forum.dlang.org

I just upgraded a machine to Linux Mint 20 on a fresh install and tried to run
the install script. It fails with
main: line 178: USERPROFILE: unbound variable

This line should only be called on Windows, which I found strange. It turns out
that this is driven by

posix_terminal() {


if [ "$SHLVL" = 1 ]; then false else true fi } ``` Running `echo $SHLVL` prints `1` Running ``` bash echo $SHLVL ``` prints `2` Running `echo $SHELL` prints `/bin/bash` The issue seems to be related to an update to Ubuntu 16: https://askubuntu.com/questions/856532/why-is-shlvl-initially-2-in-ubuntu-16-10-but-not-earlier-versions --
Jul 20 2020