From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 09/10] t/t9001-send-email.sh: use the $( ... ) construct for command substitution Date: Fri, 8 Jan 2016 12:06:27 +0100 Message-ID: <1452251188-12939-10-git-send-email-gitter.spiros@gmail.com> References: <1452251188-12939-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jan 08 12:07:00 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aHUsf-0002wj-8Q for gcvg-git-2@plane.gmane.org; Fri, 08 Jan 2016 12:06:53 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754711AbcAHLGu (ORCPT ); Fri, 8 Jan 2016 06:06:50 -0500 Received: from mail-pa0-f68.google.com ([209.85.220.68]:36291 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754726AbcAHLGl (ORCPT ); Fri, 8 Jan 2016 06:06:41 -0500 Received: by mail-pa0-f68.google.com with SMTP id a20so16337653pag.3 for ; Fri, 08 Jan 2016 03:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZrcwgGo0Th4BtUkYra6sjYsknkizY1MAfkCiJebaGkI=; b=Tg3QdzRFbrXWEZiInxVVKRDehGA/yqbltGyacxWr2DbG6GBsthyNaDBZseS3phsIPL A3fcQpwcVkJZekdc3VUNXMJa7pV5pVmfV4vR2frIHi7AuvafJHvyITnVeBzALqXHXBbV ITGH6k31FhZDiNbGBMbPOO8be1dDMYFuI+6T6oJc+bzF+9Yz7AYfeNGeRuEG1PCUQECK VCk/ZKspLhTT62WAC9LZa2+5J96jYlE/VIsPa+HeCt+vzx4uUY2FLDHFnYk7NthQ5v7L DgC5xmhYzvYEjRU2pxVAtWbyKmJUPu4T3XxMVkFFDsT2uEWoj0/9omZOixoC9VpfxOS0 BI3w== X-Received: by 10.66.124.200 with SMTP id mk8mr41864363pab.43.1452251201062; Fri, 08 Jan 2016 03:06:41 -0800 (PST) Received: from ubuntu14.nephoscale.com (static-67.207.195.141.nephosdns.com. [67.207.195.141]) by smtp.gmail.com with ESMTPSA id fi16sm93143771pac.12.2016.01.08.03.06.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 03:06:40 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452251188-12939-1-git-send-email-gitter.spiros@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The Git CodingGuidelines prefer the $(...) construct for command substitution instead of using the backquotes `...`. The backquoted form is the traditional method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. The patch was generated by: for _f in $(find . -name "*.sh") do perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}" done and then carefully proof-read. Signed-off-by: Elia Pinto --- t/t9001-send-email.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 3c49536..05949a1 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -36,7 +36,7 @@ clean_fake_sendmail () { } test_expect_success $PREREQ 'Extract patches' ' - patches=`git format-patch -s --cc="One " --cc=two@example.com -n HEAD^1` + patches=$(git format-patch -s --cc="One " --cc=two@example.com -n HEAD^1) ' # Test no confirm early to ensure remaining tests will not hang @@ -1151,7 +1151,7 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' ' ' test_expect_success $PREREQ 'patches To headers are used by default' ' - patch=`git format-patch -1 --to="bodies@example.com"` && + patch=$(git format-patch -1 --to="bodies@example.com") && test_when_finished "rm $patch" && git send-email \ --dry-run \ @@ -1162,7 +1162,7 @@ test_expect_success $PREREQ 'patches To headers are used by default' ' ' test_expect_success $PREREQ 'patches To headers are appended to' ' - patch=`git format-patch -1 --to="bodies@example.com"` && + patch=$(git format-patch -1 --to="bodies@example.com") && test_when_finished "rm $patch" && git send-email \ --dry-run \ @@ -1175,8 +1175,8 @@ test_expect_success $PREREQ 'patches To headers are appended to' ' ' test_expect_success $PREREQ 'To headers from files reset each patch' ' - patch1=`git format-patch -1 --to="bodies@example.com"` && - patch2=`git format-patch -1 --to="other@example.com" HEAD~` && + patch1=$(git format-patch -1 --to="bodies@example.com") && + patch2=$(git format-patch -1 --to="other@example.com" HEAD~) && test_when_finished "rm $patch1 && rm $patch2" && git send-email \ --dry-run \ -- 2.3.3.GIT