{"thread":{"id":"41159","subject":"[PATCHv2] t/t9001-send-email.sh: use the $( ... ) construct for command substitution","startedAt":"2016-01-11T13:34:09Z","lastAt":"2016-01-11T13:34:09Z","messageCount":1,"participants":["Elia Pinto"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"275639","messageId":"1452519249-5322-1-git-send-email-gitter.spiros@gmail.com","threadId":"41159","inReplyTo":null,"subject":"[PATCHv2] t/t9001-send-email.sh: use the $( ... ) construct for command substitution","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2016-01-11T13:34:09Z","receivedAt":"2016-01-11T13:34:09Z","isPatch":false,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The Git CodingGuidelines prefer the $(...) construct for command\nsubstitution instead of using the backquotes `...`.\n\nThe backquoted form is the traditional method for command\nsubstitution, and is supported by POSIX.  However, all but the\nsimplest uses become complicated quickly.  In particular, embedded\ncommand substitutions and/or the use of double quotes require\ncareful escaping with the backslash character.\n\nThe patch was generated by:\n\n  for _f in $(find . -name \"*.sh\")\n  do\n      perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\\$(\\1)/smg'  \"${_f}\"\n  done\n\nand then carefully proof-read.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nThis second version replaces the previous\ncorrecting another patch to t9001-send-email.sh.\n\nRefs\n\nhttp://permalink.gmane.org/gmane.comp.version-control.git/283542\nhttp://permalink.gmane.org/gmane.comp.version-control.git/283543\n\n\n t/t9001-send-email.sh | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 3c49536..0460880 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -36,7 +36,7 @@ clean_fake_sendmail () {\n }\n \n test_expect_success $PREREQ 'Extract patches' '\n-\tpatches=`git format-patch -s --cc=\"One <one@example.com>\" --cc=two@example.com -n HEAD^1`\n+\tpatches=$(git format-patch -s --cc=\"One <one@example.com>\" --cc=two@example.com -n HEAD^1)\n '\n \n # Test no confirm early to ensure remaining tests will not hang\n@@ -1151,7 +1151,7 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' '\n '\n \n test_expect_success $PREREQ 'patches To headers are used by default' '\n-\tpatch=`git format-patch -1 --to=\"bodies@example.com\"` &&\n+\tpatch=$(git format-patch -1 --to=\"bodies@example.com\") &&\n \ttest_when_finished \"rm $patch\" &&\n \tgit send-email \\\n \t\t--dry-run \\\n@@ -1162,7 +1162,7 @@ test_expect_success $PREREQ 'patches To headers are used by default' '\n '\n \n test_expect_success $PREREQ 'patches To headers are appended to' '\n-\tpatch=`git format-patch -1 --to=\"bodies@example.com\"` &&\n+\tpatch=$(git format-patch -1 --to=\"bodies@example.com\") &&\n \ttest_when_finished \"rm $patch\" &&\n \tgit send-email \\\n \t\t--dry-run \\\n@@ -1175,8 +1175,8 @@ test_expect_success $PREREQ 'patches To headers are appended to' '\n '\n \n test_expect_success $PREREQ 'To headers from files reset each patch' '\n-\tpatch1=`git format-patch -1 --to=\"bodies@example.com\"` &&\n-\tpatch2=`git format-patch -1 --to=\"other@example.com\" HEAD~` &&\n+\tpatch1=$(git format-patch -1 --to=\"bodies@example.com\") &&\n+\tpatch2=$(git format-patch -1 --to=\"other@example.com\" HEAD~) &&\n \ttest_when_finished \"rm $patch1 && rm $patch2\" &&\n \tgit send-email \\\n \t\t--dry-run \\\n@@ -1488,7 +1488,7 @@ test_cover_addresses () {\n \tclean_fake_sendmail &&\n \trm -fr outdir &&\n \tgit format-patch --cover-letter -2 -o outdir &&\n-\tcover=`echo outdir/0000-*.patch` &&\n+\tcover=$(echo outdir/0000-*.patch) &&\n \tmv $cover cover-to-edit.patch &&\n \tperl -pe \"s/^From:/$header: extra\\@address.com\\nFrom:/\" cover-to-edit.patch >\"$cover\" &&\n \tgit send-email \\\n-- \n2.3.3.GIT\n"}]}