delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/07/23:25:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <42CDF227.1090007@byu.net>
Date: Thu, 07 Jul 2005 21:25:27 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
CC: Angelo Graziosi <Angelo DOT Graziosi AT roma1 DOT infn DOT it>
Subject: Re: Problems with ash-20040127-3 (Attn: bash maintainer)
References: <Pine DOT OSF DOT 4 DOT 21 DOT 0507080133340 DOT 15260-200000 AT ax0rm1 DOT roma1 DOT infn DOT it> <Pine DOT GSO DOT 4 DOT 61 DOT 0507072020520 DOT 29317 AT slinky DOT cs DOT nyu DOT edu>
In-Reply-To: <Pine.GSO.4.61.0507072020520.29317@slinky.cs.nyu.edu>
X-IsSubscribed: yes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Igor Pechtchanski on 7/7/2005 6:34 PM:
> Yep.  The new /bin/sh is bash.  Apparently, bash doesn't like the
> following line:
> 
> if [ "`echo $dllname | sed 's{^lib/.*\.dll${{'`" != "$dllname" ]; then
> 
> because in bash, ${ has special meaning -- it starts a variable reference.
> FWIW, I get the same error with "bash -n wingcc_ld.sh" when bash is
> version 2.05b.  I suspect this may actually be a bug in bash, since single
> quotes ought to stop it from trying to expand variable references.  This
> only happens when the single quotes are inside a shell substitution (i.e.,
> "echo '${'" works, but "echo `echo '${'`" doesn't).  Nevertheless,
> changing the '{' to any other character (e.g., '#') in the sed script
> makes it parse correctly.

Another workaround is to use the alternative command substitution syntax
(which also has the nice property of being easier to read and nest):

if [ "$(echo $dllname | sed 's{^lib/.*\.dll${{')" != "$dllname" ]; then

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCzfIn84KuGfSFAYARAkTGAJ9p+GsMnsnE6p/UGFJYWPbpSTFuqACZAZ4r
tNI0RRHV+7Z1klcn9l1hIt0=
=ARRq
-----END PGP SIGNATURE-----

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

- Raw text -


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