{"thread":{"id":"22402","subject":"[PATCH] fix portability issues with $ in double quotes","startedAt":"2010-01-26T23:08:31Z","lastAt":"2010-01-27T19:16:00Z","messageCount":4,"participants":["Stephen Boyd","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"132724","messageId":"1264547311-25251-1-git-send-email-bebarino@gmail.com","threadId":"22402","inReplyTo":null,"subject":"[PATCH] fix portability issues with $ in double quotes","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-01-26T23:08:31Z","receivedAt":"2010-01-26T23:08:31Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Using a dollar sign in double quotes isn't portable. Escape them with\na backslash or replace the double quotes with single quotes.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n git-filter-branch.sh            |    4 +-\n git-instaweb.sh                 |    2 +-\n git-rebase--interactive.sh      |    2 +-\n t/t3408-rebase-multi-line.sh    |    4 +-\n t/t4014-format-patch.sh         |   44 +++++++++++++++++++-------------------\n t/t4125-apply-ws-fuzz.sh        |    4 +-\n t/t4150-am.sh                   |    6 ++--\n t/t4202-log.sh                  |    6 ++--\n t/t6023-merge-file.sh           |    4 +-\n t/t7500-commit.sh               |    2 +-\n t/t9001-send-email.sh           |    8 +++---\n t/t9400-git-cvsserver-server.sh |   18 ++++++++--------\n 12 files changed, 52 insertions(+), 52 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 195b5ef..81fd3db 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -462,11 +462,11 @@ if [ \"$filter_tag_name\" ]; then\n \t\t\t\t\t\t\"$new_sha1\" \"$new_ref\"\n \t\t\t\tgit cat-file tag \"$ref\" |\n \t\t\t\tsed -n \\\n-\t\t\t\t    -e \"1,/^$/{\n+\t\t\t\t    -e '1,/^$/{\n \t\t\t\t\t  /^object /d\n \t\t\t\t\t  /^type /d\n \t\t\t\t\t  /^tag /d\n-\t\t\t\t\t}\" \\\n+\t\t\t\t\t}' \\\n \t\t\t\t    -e '/^-----BEGIN PGP SIGNATURE-----/q' \\\n \t\t\t\t    -e 'p' ) |\n \t\t\t\tgit mktag) ||\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex b8e6456..6a65f25 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -320,7 +320,7 @@ EOF\n \telse\n \t\t# plain-old CGI\n \t\tresolve_full_httpd\n-\t\tlist_mods=$(echo \"$full_httpd\" | sed \"s/-f$/-l/\")\n+\t\tlist_mods=$(echo \"$full_httpd\" | sed 's/-f$/-l/')\n \t\t$list_mods | sane_grep 'mod_cgi\\.c' >/dev/null 2>&1 || \\\n \t\tif test -f \"$module_path/mod_cgi.so\"\n \t\tthen\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 9187e9b..19a608c 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -407,7 +407,7 @@ update_squash_messages () {\n }\n \n peek_next_command () {\n-\tsed -n -e \"/^#/d\" -e \"/^$/d\" -e \"s/ .*//p\" -e \"q\" < \"$TODO\"\n+\tsed -n -e \"/^#/d\" -e '/^$/d' -e \"s/ .*//p\" -e \"q\" < \"$TODO\"\n }\n \n # A squash/fixup has failed.  Prepare the long version of the squash\ndiff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh\nindex e12cd57..2062b85 100755\n--- a/t/t3408-rebase-multi-line.sh\n+++ b/t/t3408-rebase-multi-line.sh\n@@ -32,8 +32,8 @@ test_expect_success rebase '\n \n \tgit checkout side &&\n \tgit rebase master &&\n-\tgit cat-file commit HEAD | sed -e \"1,/^$/d\" >actual &&\n-\tgit cat-file commit side@{1} | sed -e \"1,/^$/d\" >expect &&\n+\tgit cat-file commit HEAD | sed -e \"1,/^\\$/d\" >actual &&\n+\tgit cat-file commit side@{1} | sed -e \"1,/^\\$/d\" >expect &&\n \ttest_cmp expect actual\n \n '\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 3bc1ccc..f2a2aaa 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -93,9 +93,9 @@ test_expect_success 'extra headers' '\n \tgit config --add format.headers \"Cc: S. E. Cipient <scipient@example.com>\n \" &&\n \tgit format-patch --stdout master..side > patch2 &&\n-\tsed -e \"/^$/q\" patch2 > hdrs2 &&\n-\tgrep \"^To: R. E. Cipient <rcipient@example.com>$\" hdrs2 &&\n-\tgrep \"^Cc: S. E. Cipient <scipient@example.com>$\" hdrs2\n+\tsed -e \"/^\\$/q\" patch2 > hdrs2 &&\n+\tgrep \"^To: R. E. Cipient <rcipient@example.com>\\$\" hdrs2 &&\n+\tgrep \"^Cc: S. E. Cipient <scipient@example.com>\\$\" hdrs2\n \n '\n \n@@ -104,9 +104,9 @@ test_expect_success 'extra headers without newlines' '\n \tgit config --replace-all format.headers \"To: R. E. Cipient <rcipient@example.com>\" &&\n \tgit config --add format.headers \"Cc: S. E. Cipient <scipient@example.com>\" &&\n \tgit format-patch --stdout master..side >patch3 &&\n-\tsed -e \"/^$/q\" patch3 > hdrs3 &&\n-\tgrep \"^To: R. E. Cipient <rcipient@example.com>$\" hdrs3 &&\n-\tgrep \"^Cc: S. E. Cipient <scipient@example.com>$\" hdrs3\n+\tsed -e \"/^\\$/q\" patch3 > hdrs3 &&\n+\tgrep \"^To: R. E. Cipient <rcipient@example.com>\\$\" hdrs3 &&\n+\tgrep \"^Cc: S. E. Cipient <scipient@example.com>\\$\" hdrs3\n \n '\n \n@@ -115,32 +115,32 @@ test_expect_success 'extra headers with multiple To:s' '\n \tgit config --replace-all format.headers \"To: R. E. Cipient <rcipient@example.com>\" &&\n \tgit config --add format.headers \"To: S. E. Cipient <scipient@example.com>\" &&\n \tgit format-patch --stdout master..side > patch4 &&\n-\tsed -e \"/^$/q\" patch4 > hdrs4 &&\n-\tgrep \"^To: R. E. Cipient <rcipient@example.com>,$\" hdrs4 &&\n-\tgrep \"^ *S. E. Cipient <scipient@example.com>$\" hdrs4\n+\tsed -e \"/^\\$/q\" patch4 > hdrs4 &&\n+\tgrep \"^To: R. E. Cipient <rcipient@example.com>,\\$\" hdrs4 &&\n+\tgrep \"^ *S. E. Cipient <scipient@example.com>\\$\" hdrs4\n '\n \n test_expect_success 'additional command line cc' '\n \n \tgit config --replace-all format.headers \"Cc: R. E. Cipient <rcipient@example.com>\" &&\n-\tgit format-patch --cc=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^$/q\" >patch5 &&\n-\tgrep \"^Cc: R. E. Cipient <rcipient@example.com>,$\" patch5 &&\n-\tgrep \"^ *S. E. Cipient <scipient@example.com>$\" patch5\n+\tgit format-patch --cc=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch5 &&\n+\tgrep \"^Cc: R. E. Cipient <rcipient@example.com>,\\$\" patch5 &&\n+\tgrep \"^ *S. E. Cipient <scipient@example.com>\\$\" patch5\n '\n \n test_expect_success 'command line headers' '\n \n \tgit config --unset-all format.headers &&\n-\tgit format-patch --add-header=\"Cc: R. E. Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^$/q\" >patch6 &&\n-\tgrep \"^Cc: R. E. Cipient <rcipient@example.com>$\" patch6\n+\tgit format-patch --add-header=\"Cc: R. E. Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch6 &&\n+\tgrep \"^Cc: R. E. Cipient <rcipient@example.com>\\$\" patch6\n '\n \n test_expect_success 'configuration headers and command line headers' '\n \n \tgit config --replace-all format.headers \"Cc: R. E. Cipient <rcipient@example.com>\" &&\n-\tgit format-patch --add-header=\"Cc: S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^$/q\" >patch7 &&\n-\tgrep \"^Cc: R. E. Cipient <rcipient@example.com>,$\" patch7 &&\n-\tgrep \"^ *S. E. Cipient <scipient@example.com>$\" patch7\n+\tgit format-patch --add-header=\"Cc: S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch7 &&\n+\tgrep \"^Cc: R. E. Cipient <rcipient@example.com>,\\$\" patch7 &&\n+\tgrep \"^ *S. E. Cipient <scipient@example.com>\\$\" patch7\n '\n \n test_expect_success 'multiple files' '\n@@ -406,9 +406,9 @@ test_expect_success 'cover-letter inherits diff options' '\n \tgit mv file foo &&\n \tgit commit -m foo &&\n \tgit format-patch --cover-letter -1 &&\n-\t! grep \"file => foo .* 0 *$\" 0000-cover-letter.patch &&\n+\t! grep \"file => foo .* 0 *\\$\" 0000-cover-letter.patch &&\n \tgit format-patch --cover-letter -1 -M &&\n-\tgrep \"file => foo .* 0 *$\" 0000-cover-letter.patch\n+\tgrep \"file => foo .* 0 *\\$\" 0000-cover-letter.patch\n \n '\n \n@@ -425,7 +425,7 @@ EOF\n test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '\n \n \tgit format-patch --cover-letter -2 &&\n-\tsed -e \"1,/A U Thor/d\" -e \"/^$/q\" < 0000-cover-letter.patch > output &&\n+\tsed -e \"1,/A U Thor/d\" -e \"/^\\$/q\" < 0000-cover-letter.patch > output &&\n \ttest_cmp expect output\n \n '\n@@ -450,7 +450,7 @@ EOF\n test_expect_success 'format-patch respects -U' '\n \n \tgit format-patch -U4 -2 &&\n-\tsed -e \"1,/^$/d\" -e \"/^+5/q\" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&\n+\tsed -e \"1,/^\\$/d\" -e \"/^+5/q\" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&\n \ttest_cmp expect output\n \n '\n@@ -471,7 +471,7 @@ EOF\n test_expect_success 'format-patch -p suppresses stat' '\n \n \tgit format-patch -p -2 &&\n-\tsed -e \"1,/^$/d\" -e \"/^+5/q\" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&\n+\tsed -e \"1,/^\\$/d\" -e \"/^+5/q\" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&\n \ttest_cmp expect output\n \n '\ndiff --git a/t/t4125-apply-ws-fuzz.sh b/t/t4125-apply-ws-fuzz.sh\nindex 3b471b6..9671de7 100755\n--- a/t/t4125-apply-ws-fuzz.sh\n+++ b/t/t4125-apply-ws-fuzz.sh\n@@ -37,11 +37,11 @@ test_expect_success setup '\n \t# patch-2 is the same as patch-1 but is based\n \t# on a version that already has whitespace fixed,\n \t# and does not introduce whitespace breakages.\n-\tsed -e \"s/ $//\" patch-1 >patch-2 &&\n+\tsed -e \"s/ \\$//\" patch-1 >patch-2 &&\n \n \t# If all whitespace breakages are fixed the contents\n \t# should look like file-fixed\n-\tsed -e \"s/ $//\" file-1 >file-fixed\n+\tsed -e \"s/ \\$//\" file-1 >file-fixed\n \n '\n \ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex a034918..810b04b 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -302,7 +302,7 @@ test_expect_success 'am --committer-date-is-author-date' '\n \tgit checkout first &&\n \ttest_tick &&\n \tgit am --committer-date-is-author-date patch1 &&\n-\tgit cat-file commit HEAD | sed -e \"/^$/q\" >head1 &&\n+\tgit cat-file commit HEAD | sed -e \"/^\\$/q\" >head1 &&\n \tat=$(sed -ne \"/^author /s/.*> //p\" head1) &&\n \tct=$(sed -ne \"/^committer /s/.*> //p\" head1) &&\n \ttest \"$at\" = \"$ct\"\n@@ -312,7 +312,7 @@ test_expect_success 'am without --committer-date-is-author-date' '\n \tgit checkout first &&\n \ttest_tick &&\n \tgit am patch1 &&\n-\tgit cat-file commit HEAD | sed -e \"/^$/q\" >head1 &&\n+\tgit cat-file commit HEAD | sed -e \"/^\\$/q\" >head1 &&\n \tat=$(sed -ne \"/^author /s/.*> //p\" head1) &&\n \tct=$(sed -ne \"/^committer /s/.*> //p\" head1) &&\n \ttest \"$at\" != \"$ct\"\n@@ -326,7 +326,7 @@ test_expect_success 'am --ignore-date' '\n \tgit checkout first &&\n \ttest_tick &&\n \tgit am --ignore-date patch1 &&\n-\tgit cat-file commit HEAD | sed -e \"/^$/q\" >head1 &&\n+\tgit cat-file commit HEAD | sed -e \"/^\\$/q\" >head1 &&\n \tat=$(sed -ne \"/^author /s/.*> //p\" head1) &&\n \techo \"$at\" | grep \"+0000\"\n '\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 779a5ad..1dc224f 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -255,7 +255,7 @@ EOF\n \n test_expect_success 'log --graph with merge' '\n \tgit log --graph --date-order --pretty=tformat:%s |\n-\t\tsed \"s/ *$//\" >actual &&\n+\t\tsed \"s/ *\\$//\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -315,7 +315,7 @@ EOF\n test_expect_success 'log --graph with full output' '\n \tgit log --graph --date-order --pretty=short |\n \t\tgit name-rev --name-only --stdin |\n-\t\tsed \"s/Merge:.*/Merge: A B/;s/ *$//\" >actual &&\n+\t\tsed \"s/Merge:.*/Merge: A B/;s/ *\\$//\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -383,7 +383,7 @@ EOF\n \n test_expect_success 'log --graph with merge' '\n \tgit log --graph --date-order --pretty=tformat:%s |\n-\t\tsed \"s/ *$//\" >actual &&\n+\t\tsed \"s/ *\\$//\" >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex 7dcf391..6291307 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -146,8 +146,8 @@ test_expect_success 'binary files cannot be merged' '\n \tgrep \"Cannot merge binary files\" merge.err\n '\n \n-sed -e \"s/deerit.$/deerit;/\" -e \"s/me;$/me./\" < new5.txt > new6.txt\n-sed -e \"s/deerit.$/deerit,/\" -e \"s/me;$/me,/\" < new5.txt > new7.txt\n+sed -e \"s/deerit.\\$/deerit;/\" -e \"s/me;\\$/me./\" < new5.txt > new6.txt\n+sed -e \"s/deerit.\\$/deerit,/\" -e \"s/me;\\$/me,/\" < new5.txt > new7.txt\n \n test_expect_success 'MERGE_ZEALOUS simplifies non-conflicts' '\n \ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex 8eec0fa..9f5c3ed 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -150,7 +150,7 @@ EOF\n test_expect_success '--signoff' '\n \techo \"yet another content *narf*\" >> foo &&\n \techo \"zort\" | git commit -s -F - foo &&\n-\tgit cat-file commit HEAD | sed \"1,/^$/d\" > output &&\n+\tgit cat-file commit HEAD | sed \"1,/^\\$/d\" > output &&\n \ttest_cmp expect output\n '\n \ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 752adaa..c09f375 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -186,8 +186,8 @@ test_expect_success 'Prompting works' '\n \t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t$patches \\\n \t\t2>errors &&\n-\t\tgrep \"^From: Example <from@example.com>$\" msgtxt1 &&\n-\t\tgrep \"^To: to@example.com$\" msgtxt1\n+\t\tgrep \"^From: Example <from@example.com>\\$\" msgtxt1 &&\n+\t\tgrep \"^To: to@example.com\\$\" msgtxt1\n '\n \n test_expect_success 'cccmd works' '\n@@ -236,7 +236,7 @@ test_expect_success 'Author From: in message body' '\n \t\t--to=nobody@example.com \\\n \t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t$patches &&\n-\tsed \"1,/^$/d\" < msgtxt1 > msgbody1\n+\tsed \"1,/^\\$/d\" < msgtxt1 > msgbody1\n \tgrep \"From: A <author@example.com>\" msgbody1\n '\n \n@@ -247,7 +247,7 @@ test_expect_success 'Author From: not in message body' '\n \t\t--to=nobody@example.com \\\n \t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t$patches &&\n-\tsed \"1,/^$/d\" < msgtxt1 > msgbody1\n+\tsed \"1,/^\\$/d\" < msgtxt1 > msgbody1\n \t! grep \"From: A <author@example.com>\" msgbody1\n '\n \ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex c2ec3cb..4327eb8 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -96,7 +96,7 @@ EOF\n \n test_expect_success 'pserver authentication' \\\n   'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n test_expect_success 'pserver authentication failure (non-anonymous user)' \\\n   'if cat request-git | git-cvsserver pserver >log 2>&1\n@@ -105,11 +105,11 @@ test_expect_success 'pserver authentication failure (non-anonymous user)' \\\n    else\n        true\n    fi &&\n-   sed -ne \\$p log | grep \"^I HATE YOU$\"'\n+   sed -ne \\$p log | grep \"^I HATE YOU\\$\"'\n \n test_expect_success 'pserver authentication (login)' \\\n   'cat login-anonymous | git-cvsserver pserver >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n test_expect_success 'pserver authentication failure (login/non-anonymous user)' \\\n   'if cat login-git | git-cvsserver pserver >log 2>&1\n@@ -118,7 +118,7 @@ test_expect_success 'pserver authentication failure (login/non-anonymous user)'\n    else\n        true\n    fi &&\n-   sed -ne \\$p log | grep \"^I HATE YOU$\"'\n+   sed -ne \\$p log | grep \"^I HATE YOU\\$\"'\n \n \n # misuse pserver authentication for testing of req_Root\n@@ -156,7 +156,7 @@ test_expect_success 'req_Root failure (conflicting roots)' \\\n \n test_expect_success 'req_Root (strict paths)' \\\n   'cat request-anonymous | git-cvsserver --strict-paths pserver \"$SERVERDIR\" >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n test_expect_success 'req_Root failure (strict-paths)' '\n     ! cat request-anonymous |\n@@ -165,7 +165,7 @@ test_expect_success 'req_Root failure (strict-paths)' '\n \n test_expect_success 'req_Root (w/o strict-paths)' \\\n   'cat request-anonymous | git-cvsserver pserver \"$WORKDIR/\" >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n test_expect_success 'req_Root failure (w/o strict-paths)' '\n     ! cat request-anonymous |\n@@ -183,7 +183,7 @@ EOF\n \n test_expect_success 'req_Root (base-path)' \\\n   'cat request-base | git-cvsserver --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n test_expect_success 'req_Root failure (base-path)' '\n     ! cat request-anonymous |\n@@ -194,14 +194,14 @@ GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false || exit 1\n \n test_expect_success 'req_Root (export-all)' \\\n   'cat request-anonymous | git-cvsserver --export-all pserver \"$WORKDIR\" >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n test_expect_success 'req_Root failure (export-all w/o whitelist)' \\\n   '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'\n \n test_expect_success 'req_Root (everything together)' \\\n   'cat request-base | git-cvsserver --export-all --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n-   sed -ne \\$p log | grep \"^I LOVE YOU$\"'\n+   sed -ne \\$p log | grep \"^I LOVE YOU\\$\"'\n \n GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true || exit 1\n \n-- \n1.7.0.rc0.8.ge3f67d\n"},{"id":"132751","messageId":"4B5FF106.3070604@viscovery.net","threadId":"22402","inReplyTo":"1264547311-25251-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH] fix portability issues with $ in double quotes","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-01-27T07:53:42Z","receivedAt":"2010-01-27T07:53:42Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Stephen Boyd schrieb:\n> Using a dollar sign in double quotes isn't portable. Escape them with\n> a backslash or replace the double quotes with single quotes.\n\nThe instances you changed look good. I didn't check whether you missed\nsome. Was this some sort of mechanical change?\n\nI must say that a backslash in front of a $ in a sed expression looks very\ndistracting:\n\n> +\tgit cat-file commit HEAD | sed -e \"1,/^\\$/d\" >actual &&\n> +\tgit cat-file commit side@{1} | sed -e \"1,/^\\$/d\" >expect &&\n\nbecause it is easy to miss that the backslash is taken by the\ndouble-quotes. But since these cases happen in the test suite where the\nwhole thing is in single-quotes already, I don't think we can do something\nabout it without making it even more unreadable...\n\n-- Hannes\n"},{"id":"132820","messageId":"4B608A3C.7090106@gmail.com","threadId":"22402","inReplyTo":"4B5FF106.3070604@viscovery.net","subject":"Re: [PATCH] fix portability issues with $ in double quotes","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-01-27T18:47:24Z","receivedAt":"2010-01-27T18:47:24Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 01/26/2010 11:53 PM, Johannes Sixt wrote:\n> The instances you changed look good. I didn't check whether you missed\n> some. Was this some sort of mechanical change?\n\nNot really mechanical. I just grepped for sed and grep expressions and \nthen went through the results by hand looking for unescaped dollar signs.\n"},{"id":"132827","messageId":"7v636nqryn.fsf@alter.siamese.dyndns.org","threadId":"22402","inReplyTo":"4B608A3C.7090106@gmail.com","subject":"Re: [PATCH] fix portability issues with $ in double quotes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-27T19:16:00Z","receivedAt":"2010-01-27T19:16:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> On 01/26/2010 11:53 PM, Johannes Sixt wrote:\n>> The instances you changed look good. I didn't check whether you missed\n>> some. Was this some sort of mechanical change?\n>\n> Not really mechanical. I just grepped for sed and grep expressions and\n> then went through the results by hand looking for unescaped dollar\n> signs.\n\nThanks; with this (and my earlier rant on bash refusing to redirect with\n'cmd <$variable' when $variable has $IFS character and is not quoted), the\nresult seem to make my OpenBSD build pass all the tests ;-)\n"}]}