From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCHv2] t/t9001-send-email.sh: use the $( ... ) construct for command substitution Date: Mon, 11 Jan 2016 14:34:09 +0100 Message-ID: <1452519249-5322-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Jan 11 14:34:20 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 1aIcbz-00017G-Dd for gcvg-git-2@plane.gmane.org; Mon, 11 Jan 2016 14:34:19 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759568AbcAKNeQ (ORCPT ); Mon, 11 Jan 2016 08:34:16 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34669 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759207AbcAKNeP (ORCPT ); Mon, 11 Jan 2016 08:34:15 -0500 Received: by mail-pa0-f43.google.com with SMTP id uo6so304615203pac.1 for ; Mon, 11 Jan 2016 05:34:14 -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; bh=HZ61CyX4aNnnaUhvY5wQl6RVttordtKgGtynJUhtj8c=; b=Hd8Oy8H+cC2CN8l6OHB5lABxElSYKoHFIkNs3JpTpkjlCKBe1dSTlAIJMUN6wf4nLg 6SxOgjMScYEF6z0CjhAz186uZ4Xfh+5L23We23o+IT+b3EfeOip+lZ/frAjNA2+oWI5j qqV8ti8kIiSg5xJVfN/pahyEzyg6SmH+qTtLbQcEV4CGahcZmgtZXwS1xHjQ6ku2feGT p23ZZ5yGuK2PjNkwFGx8NK5AGo5XnUWYSN/lQRpXUmr3QcnlxyQRJPmN0oEGP22aPN2C P2X4Zd3jWPZm+TtK7TM0JXv1iM9FVurdNxY5yLfMJpqA+CiGQadJGF+xv6HUEljNFYC/ DU9A== X-Received: by 10.67.6.233 with SMTP id cx9mr119787562pad.54.1452519254545; Mon, 11 Jan 2016 05:34:14 -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 g87sm23509692pfj.1.2016.01.11.05.34.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 05:34:13 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT 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 --- This second version replaces the previous correcting another patch to t9001-send-email.sh. Refs http://permalink.gmane.org/gmane.comp.version-control.git/283542 http://permalink.gmane.org/gmane.comp.version-control.git/283543 t/t9001-send-email.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 3c49536..0460880 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 \ @@ -1488,7 +1488,7 @@ test_cover_addresses () { clean_fake_sendmail && rm -fr outdir && git format-patch --cover-letter -2 -o outdir && - cover=`echo outdir/0000-*.patch` && + cover=$(echo outdir/0000-*.patch) && mv $cover cover-to-edit.patch && perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" && git send-email \ -- 2.3.3.GIT