From: Herbert Xu Date: Mon, 07 May 2007 08:01:17 GMT Subject: Re: [PATCH] git-parse-remote: fix ambiguous shell bug in expand_refs_wildcard Message-ID: <20070507080117.GA5302@gondor.apana.org.au> In-Reply-To: <20070507063621.GB31445@coredump.intra.peff.net> On Mon, May 07, 2007 at 02:36:22AM -0400, Jeff King wrote: > > It looks like bash is actually broken in POSIXLY_CORRECT mode, then: > > $ echo $BASH_VERSION > 3.1.17(1)-release > $ POSIXLY_CORRECT=1 > $ foo=bar} > $ echo "${foo%'}'}" > bar > > My interpretation of the correct behavior is that it should remove a > single quote from the end of foo, and then print '} literally (that is, > single quote and brace). Well strictly speaking this is allowed by the standard as this usage contains an odd number of single quotes inside an ${...} expression enclosed by double quotes, which behaves in an implementation-specific manner. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt