git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: POSIX woes in t7810.87: dash bash or bash dash?
Date: Mon, 20 Jun 2011 19:24:25 -0400	[thread overview]
Message-ID: <20110620232425.GA617@sigill.intra.peff.net> (raw)
In-Reply-To: <7voc1sb2hr.fsf@alter.siamese.dyndns.org>

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).

-Peff

  reply	other threads:[~2011-06-20 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20  9:58 POSIX woes in t7810.87: dash bash or bash dash? Michael J Gruber
2011-06-20 11:04 ` Jonathan Nieder
2011-06-20 17:13   ` Jeff King
2011-06-20 21:46 ` Junio C Hamano
2011-06-20 23:24   ` Jeff King [this message]
2011-06-20 23:31     ` Junio C Hamano
2011-06-21  0:21       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110620232425.GA617@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).