dash incompatibility in /etc/profile

Charles Wilson cygwin@cwilson.fastmail.fm
Sun Aug 21 18:51:00 GMT 2011

Running 'dash -l' flags an error in /etc/profile:

if [[ -n ${BASH_VERSION} ]]; then
  profile_d sh
  [[ -f "/etc/bash.bashrc" ]] && . "/etc/bash.bashrc"
elif [[ -n ${KSH_VERSION} ]]; then
  typeset -l HOSTNAME=$(/usr/bin/hostname)
  profile_d sh
elif [[ -n ${ZSH_VERSION} ]]; then
  profile_d zsh
  PS1='(%n@%m)[%h] %~ %% '

these uses of '[[' are not supported by dash, although apparently posh
supports them.

I was trying to launch 'dash' from cmd.exe, in such a way that the
default Windows values of TMP, TMPDIR, and TEMP were overridden.  For
now I can do

> set ENV=~/.dashinit
> dash

but...can we use /bin/test or a regular '[' here?


Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list