Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: cygwin AT cygwin DOT com CC: Angelo Graziosi Subject: Re: Problems with ash-20040127-3 (Attn: bash maintainer) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/