Skip to content

Commit

Permalink
t7810: avoid unportable use of "echo"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jun 20, 2011
1 parent d0042ab commit 93d5e0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/t7810-grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down

0 comments on commit 93d5e0c

Please sign in to comment.