delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/21/14:51:22

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Message-ID: <4E51537C.3080506@cwilson.fastmail.fm>
Date: Sun, 21 Aug 2011 14:50:36 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: Cygwin Mailing List <cygwin AT cygwin DOT com>
Subject: dash incompatibility in /etc/profile
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019