Branch: Tag:

1999-04-01

1999-04-01 17:23:57 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

init_nt can now be executed rather than sourced (at least if you run bash)

Rev: NT/init_nt:1.17
Rev: NT/tools/bash-fixup:1.1

4:   REMOTE_METHOD=sprsh      # Edit - #NTHOST=10.0.4.10 - #NTDRIVE='j:' + NTHOST=10.0.4.10 + NTDRIVE='j:'    - NTHOST=localhost - NTDRIVE='d:' + #NTHOST=localhost + #NTDRIVE='d:'      # What dir on the UNIX machine is on $NTDRIVE ?   # This variable MUST NOT end with a slash.
26:      # Don't edit    + case /$0 in +  */init_nt) +  # We were executed we can find the path! +  base=`echo $0 | sed -e 's@/init_nt@@'` +  base=`(test "x$base" != "x" && cd $base ; /bin/pwd)` +  ;; +  +  *) +  # We were sourced, we cannot find the path...    base=`pwd` -  +  ;; + esac    - NP=$base/tools + NT_TOOL_PATH=$base/tools    -  + export NT_TOOL_PATH +  + if [ ! -d "$NT_TOOL_PATH" ]; then +  echo Unable to find NT tools! +  return +  exit + fi +    case :$PATH: in -  *:$NP:*) ;; -  *) PATH=$NP:$PATH ;; +  *:$NT_TOOL_PATH:*) ;; +  *) PATH=$NT_TOOL_PATH:$PATH ;;   esac -  +    CC=rntcc - NTTOOLS=$NP/lib + NTTOOLS=$NT_TOOL_PATH/lib +    if [ "x$NTMOUNT" = x ]; then    MNTREPLACE=""   else
47:      export NTHOST NTDRIVE NTCC CC PATH NTTOOLS MNTREPLACE MNTREPLACE   export NTPORT USE_SPRSH NTMOUNT IFS REMOTE_METHOD watcom INCLUDE + export NT_TOOL_PATH      case /$SHELL-$TERM in    */bash-xterm)
55:    ;;   esac    + case /$0 in +  */init_nt)    case /$SHELL in    */bash) -  if [ $REMOTE_METHOD = sprsh ]; then -  PS1="NT $NTHOST \\$ " -  else -  PS1="WINE \\$ " -  fi -  export PS1 +  exec $SHELL -rcfile $NT_TOOL_PATH/bash-fixup    ;; - esac -  -  - case /$0 in -  */init_nt) +  *)    exec $SHELL    ;;    esac -  +  ;; + esac