From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 07/10] t/t7001-mv.sh: use the $( ... ) construct for command substitution Date: Thu, 7 Jan 2016 14:51:47 +0100 Message-ID: <1452174710-28188-8-git-send-email-gitter.spiros@gmail.com> References: <1452174710-28188-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Thu Jan 07 14:52:18 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 1aHAz5-00021A-Px for gcvg-git-2@plane.gmane.org; Thu, 07 Jan 2016 14:52:12 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752719AbcAGNwE (ORCPT ); Thu, 7 Jan 2016 08:52:04 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33929 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293AbcAGNwB (ORCPT ); Thu, 7 Jan 2016 08:52:01 -0500 Received: by mail-pa0-f50.google.com with SMTP id uo6so241078382pac.1 for ; Thu, 07 Jan 2016 05:52:01 -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=Mq+0ge2z3TqsRk5I9yDkJ3rifJXWgaGbxOA7ZfzxZrE=; b=Dwkh/j4vL/v5WmDTjDyxb+OxcWG4xoFwEvc00fF0K8wbjLVVSZDAHB/+accavbSR1S VlqT1v8krD41e4dE+1ZXGeXOXt6oZqksI8bxr06h6ewUqL1EecXwztVAa1AdQUMh57VD 4efCAAHM/PqgjzUs2ZR8EODvhZrMiGmqVLof+pLT9GOEHE8zmiEJ/bQ/5pkeKn6TY40/ IqedQO5XFvluHIkx2eLKCt2/wCdTUzhNcrWxe9N6cVAVBq90veZgjwAsRDTQ7Srvw7R+ gSBysTFxrPSbxvFrue5x8KJOcs4IliIqs2bBiXV5XXkM6WvD7sz3OKVyVT+73vmJz62d 6Bmw== X-Received: by 10.66.242.17 with SMTP id wm17mr118294876pac.155.1452174721468; Thu, 07 Jan 2016 05:52:01 -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 kk5sm140627824pab.16.2016.01.07.05.52.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 05:52:00 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452174710-28188-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/t7001-mv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 7b56081..51dd2b4 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -156,11 +156,11 @@ test_expect_success "Michael Cassar's test case" ' echo b > partA/outline.txt && echo c > papers/unsorted/_another && git add papers partA && - T1=`git write-tree` && + T1=$(git write-tree) && git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf && - T=`git write-tree` && + T=$(git write-tree) && git ls-tree -r $T | verbose grep partA/outline.txt ' -- 2.3.3.GIT