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