From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 05/10] t3600-rm.sh: use the $( ... ) construct for command substitution Date: Tue, 22 Dec 2015 16:27:48 +0100 Message-ID: <1450798073-22811-6-git-send-email-gitter.spiros@gmail.com> References: <1450798073-22811-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Dec 22 16:28:25 2015 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 1aBOrQ-0002Db-9j for gcvg-git-2@plane.gmane.org; Tue, 22 Dec 2015 16:28:24 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755211AbbLVP2G (ORCPT ); Tue, 22 Dec 2015 10:28:06 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35410 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755196AbbLVP2D (ORCPT ); Tue, 22 Dec 2015 10:28:03 -0500 Received: by mail-pa0-f51.google.com with SMTP id jx14so91028174pad.2 for ; Tue, 22 Dec 2015 07:28:03 -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=fX9LcvEVrxbJhLCQf/6a1EIE3bq5fF/gCVNMkvGqFbA=; b=XgLSXMeIU8dYds0Bd2Lx4f15vqTD9vwdH7bkjtSaeqHefNQOuKR6MTlOs2IR7w57qA ddBSZqsBpozNV7yhZyt3yPwimq13vRWulUJ0sehhNAt+hK553XmrXxDRY52ogAnKd9NV r4THSWIimanrIS7yCkyfvClLiADOa9lEy90ziD0Sut828+XMwlMVpOHMomsZtIxt5QaQ Szv8iVE3uTuSN55NYz6rvWBLFzD5r5EOpqo4s6/WaSRwWK9a4haWHmfussSzWxxqqA6v S8hM3kOW6ZLPBQTvmL1gEM3bZZsr8josSc82g1ow2FgblA8VroLvBtSnsA3Ty2Oxi/hu p/Qg== X-Received: by 10.67.6.195 with SMTP id cw3mr36566559pad.88.1450798083361; Tue, 22 Dec 2015 07:28:03 -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 q190sm42030149pfq.59.2015.12.22.07.28.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 07:28:02 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1450798073-22811-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/t3600-rm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 9d90d2c..2e47a2b 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -115,7 +115,7 @@ test_expect_success '"rm" command printed' ' git add test-file && git commit -m "add file for rm test" && git rm test-file > rm-output && - test `grep "^rm " rm-output | wc -l` = 1 && + test $(grep "^rm " rm-output | wc -l) = 1 && rm -f test-file rm-output && git commit -m "remove file from rm test" ' @@ -125,7 +125,7 @@ test_expect_success '"rm" command suppressed with --quiet' ' git add test-file && git commit -m "add file for rm --quiet test" && git rm --quiet test-file > rm-output && - test `wc -l < rm-output` = 0 && + test $(wc -l < rm-output) = 0 && rm -f test-file rm-output && git commit -m "remove file from rm --quiet test" ' -- 2.3.3.GIT