This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dash incompatibility in /etc/profile


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

if [[ -n ${BASH_VERSION} ]]; then
  HOSTNAME=$(/usr/bin/hostname)
  profile_d sh
  [[ -f "/etc/bash.bashrc" ]] && . "/etc/bash.bashrc"
elif [[ -n ${KSH_VERSION} ]]; then
  typeset -l HOSTNAME=$(/usr/bin/hostname)
  profile_d sh
  PS1=$(print
'\033]0;${PWD}\n\033[32m${USER}@${HOSTNAME}\033[33m${PWD/${HOME}/}\033[0m\n$
')
elif [[ -n ${ZSH_VERSION} ]]; then
  HOSTNAME=$(/usr/bin/hostname)
  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?

--
Chuck

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]