Skip to content

Commit 93d5e0c

Browse files
committed
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 <gitster@pobox.com>
1 parent d0042ab commit 93d5e0c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

t/t7810-grep.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,9 @@ test_expect_success LIBPCRE 'grep -P -v pattern' '
658658
'
659659

660660
test_expect_success LIBPCRE 'grep -P -i pattern' '
661-
{
662-
echo "hello.c: printf(\"Hello world.\n\");"
663-
} >expected &&
661+
cat >expected <<-EOF &&
662+
hello.c: printf("Hello world.\n");
663+
EOF
664664
git grep -P -i "PRINTF\([^\d]+\)" hello.c >actual &&
665665
test_cmp expected actual
666666
'

0 commit comments

Comments
 (0)