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

Re: [PATCH] fix portability issues with $ in double quotes

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jan 27, 2010, 07:53 UTC
Message-ID
<4B5FF106.3070604@viscovery.net>
In-Reply-To
<1264547311-25251-1-git-send-email-bebarino@gmail.com>
Stephen Boyd schrieb:
> Using a dollar sign in double quotes isn't portable. Escape them with
> a backslash or replace the double quotes with single quotes.

The instances you changed look good. I didn't check whether you missed some. Was this some sort of mechanical change?

I must say that a backslash in front of a $ in a sed expression looks very distracting:

> +	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
> +	git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&

because it is easy to miss that the backslash is taken by the double-quotes. But since these cases happen in the test suite where the whole thing is in single-quotes already, I don't think we can do something about it without making it even more unreadable...

-- Hannes
Previous: Stephen BoydNext: Stephen Boyd
Message 2 of 4 in “fix portability issues with $ in double quotes”
  1. fix portability issues with $ in double quotesStephen Boyd, Jan 26, 2010
  2. Johannes SixtJan 27, 2010
  3. Stephen BoydJan 27, 2010
  4. Junio C HamanoJan 27, 2010

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.