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

Re: POSIX woes in t7810.87: dash bash or bash dash?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 20, 2011, 23:31 UTC
Message-ID
<7vwrgg9j1n.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110620232425.GA617@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> On Mon, Jun 20, 2011 at 02:46:08PM -0700, Junio C Hamano wrote:
>
>> diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
>> index 69bd576..6379ad6 100755
>> --- a/t/t7810-grep.sh
>> +++ b/t/t7810-grep.sh
>> @@ -658,9 +658,9 @@ test_expect_success LIBPCRE 'grep -P -v pattern' '
>>  '
>>  
>>  test_expect_success LIBPCRE 'grep -P -i pattern' '
>> -	{
>> -		echo "hello.c:	printf(\"Hello world.\n\");"
>> -	} >expected &&
>> +	cat >expected <<-EOF &&
>> +	hello.c:	printf("Hello world.\n");
>> +	EOF
>
> Do you need to quote EOF to suppress expansion in the here document?
> Both bash and dash seem to pass unknown backslash-escapes like "\n"
> through unharmed, but I don't know if that is portable (they do both
> munge known escapes like "\\", of course).

I do not think that is strictly necessary, as we are not in the corner of non-portable echo behaviour anymore, but I guess it wouldn't hurt.

Previous: Jeff KingNext: Jeff King
Message 6 of 7 in “POSIX woes in t7810.87: dash bash or bash dash?”
  1. Michael J GruberJun 20, 2011
  2. Jonathan NiederJun 20, 2011
  3. Jeff KingJun 20, 2011
  4. Junio C HamanoJun 20, 2011
  5. Jeff KingJun 20, 2011
  6. Junio C HamanoJun 20, 2011
  7. Jeff KingJun 21, 2011

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.