--- defaults/etc/profile 2015-09-26 09:45:02.000000000 +0200 +++ profile 2015-12-06 23:44:38.715400000 +0100 @@ -5,7 +6,7 @@ # with this software. # If not, see . -# base-files version 4.2-4 +# base-files version 4.2-3 # /etc/profile: executed by the command interpreter for login shells. @@ -31,12 +32,27 @@ # software to override 'system' software. # Modifying these default path settings can be done in different ways. # To learn more about startup files, refer to your shell's man page. - - : ${ORIGINAL_PATH=${PATH}} + # add /usr/bin,/usr/local/bin to PATH. if [ ${CYGWIN_NOWINPATH-addwinpath} = "addwinpath" ] ; then - PATH="/usr/local/bin:/usr/bin${PATH:+:${PATH}}" + # avoid multiple path-entries. + ifs="$IFS" + IFS=: + path_localbin=/usr/local/bin + path_bin=/usr/bin + for p in $PATH; do + [ -n "$path_localbin" -a "$p" = "$path_localbin" ] && path_localbin= + [ -n "$path_bin" -a "$p" = "$path_bin" ] && path_bin= + done + : ${ORIGINAL_PATH=${PATH}} + if [ -z "$path_bin" -o -z "$path_localbin" ]; then + # append : + [ -n "$path_localbin" -a -n "$path_bin$PATH" ] && path_localbin=$path_localbin: + [ -n "$path_bin" -a -n "$PATH" ] && path_bin=$path_bin: + PATH="$path_localbin$path_bin$PATH" + fi + IFS="$ifs" else - PATH="/usr/local/bin:/usr/bin" + PATH="$path_localbin:$path_bin" fi # see https://cygwin.com/ml/cygwin/2014-05/msg00352.html @@ -111,6 +127,9 @@ cd "${HOME}" || echo "WARNING: Failed attempt to cd into ${HOME}!" fi +# set default-SHELL +: ${SHELL:=/bin/sh} + # Shell dependent settings profile_d () { @@ -138,7 +157,7 @@ if [ ! "x${BASH_VERSION}" = "x" ]; then [ -f "/etc/bash.bashrc" ] && . "/etc/bash.bashrc" elif [ ! "x${KSH_VERSION}" = "x" ]; then - typeset -l HOSTNAME="$(/usr/bin/hostname)" + typeset -l HOSTNAME [ "${PS1-null}" = "null" ] || PS1=$(print '\033]0;${PWD}\n\033[32m${USER}@${HOSTNAME} \033[33m${PWD/${HOME}/~}\033[0m\n$ ') elif [ ! "x${ZSH_VERSION}" = "x" ]; then # zsh is in shell compatibility mode here, so we probably shouldn't do this @@ -151,3 +170,4 @@ # export PROFILEREAD PATH ORIGINAL_PATH MANPATH INFOPATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL tmp temp export PROFILEREAD PATH ORIGINAL_PATH INFOPATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL +