Re: [PATCH] git-parse-remote: fix ambiguous shell bug in expand_refs_wildcard
- From
- Herbert Xu <herbert@gondor.apana.org.au>
- Date
- May 7, 2007, 08:01 UTC
- 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:
Show 13 quoted lines
>
> 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~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt