This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Problems with ash-20040127-3 (Attn: bash maintainer)
-----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@byu.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/