git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-parse-remote: fix ambiguous shell bug in expand_refs_wildcard

From
HXHerbert 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
Previous: Jeff King
Message 7 of 7 in “git-parse-remote: fix ambiguous shell bug in expand_refs_wildcard”
  1. git-parse-remote: fix ambiguous shell bug in expand_refs_wildcardJeff King, Dec 18, 2006
  2. Jeff KingDec 18, 2006
  3. Jeff KingDec 18, 2006
  4. Herbert XuDec 19, 2006
  5. Herbert XuMay 5, 2007
  6. Jeff KingMay 7, 2007
  7. Herbert XuMay 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.