From 93d5e0c2087916941934b1e55c979c52f5af3f20 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 20 Jun 2011 14:49:34 -0700 Subject: t7810: avoid unportable use of "echo" Michael J Gruber noticed that under /bin/dash this test failed (as is expected -- \n in the string can be interpreted by the command), while it passed with bash. We probably could work it around by using backquote in front of it, but it is safer and more readable to avoid "echo" altogether in a case like this. Signed-off-by: Junio C Hamano 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 git grep -P -i "PRINTF\([^\d]+\)" hello.c >actual && test_cmp expected actual ' -- cgit v0.10.2-6-g49f6