From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 02/14] t0010-racy-git.sh: use the $( ... ) construct for command substitution Date: Mon, 28 Apr 2014 05:57:25 -0700 Message-ID: <1398689857-17014-2-git-send-email-gitter.spiros@gmail.com> References: <1398689857-17014-1-git-send-email-gitter.spiros@gmail.com> Cc: matthieu.moy@grenoble-inp.fr, Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Apr 28 14:57:50 2014 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 1Wel81-0003V7-NV for gcvg-git-2@plane.gmane.org; Mon, 28 Apr 2014 14:57:50 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755579AbaD1M5p (ORCPT ); Mon, 28 Apr 2014 08:57:45 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:60145 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755395AbaD1M5n (ORCPT ); Mon, 28 Apr 2014 08:57:43 -0400 Received: by mail-pb0-f54.google.com with SMTP id rp16so2403760pbb.27 for ; Mon, 28 Apr 2014 05:57:43 -0700 (PDT) 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=0F2Pog8wWErQyVq7X6yrp/qYtuqsIMtaPmNh7WQm4+s=; b=ac4U5Zo7DASzf1UCPKrpSKY4jidanUmUUFLVG91A39Zawb5sVkOS1lYePbtPARamVU aA3J0TLyrhn3k34KmpxCZ61yPLp3GMe5VYg/nFESSNZSXon2nJCIC+iPvAiQov9wd5Ng 1yEHapEUJ9I/xbuTczjTVjAc8LefqoRAFKk0XeelH+h6dGkfB2V1WAC3gH+ZBxR9ikhj bUYQF3lMTun7vCfJKQCBeghBcjeRb/t9og61FVWS0gMB6s8roZdCVG/VavRdCk4ionvd h+MCxFs46gKEvTnwTT+eNH6PNkyJ2kQT2Yn8yLX1SsLwmKSXLQLCGK5Z7YFEsegsFHAK xnTA== X-Received: by 10.68.190.163 with SMTP id gr3mr25066724pbc.103.1398689863089; Mon, 28 Apr 2014 05:57:43 -0700 (PDT) Received: from devzero2000ubu.nephoscale.com (140.195.207.67.nephoscale.net. [67.207.195.140]) by mx.google.com with ESMTPSA id ky8sm34896290pbc.64.2014.04.28.05.57.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:57:42 -0700 (PDT) X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398689857-17014-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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto --- t/t0010-racy-git.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t0010-racy-git.sh b/t/t0010-racy-git.sh index e45a9e4..5657c5a 100755 --- a/t/t0010-racy-git.sh +++ b/t/t0010-racy-git.sh @@ -14,7 +14,7 @@ do git update-index --add infocom echo xyzzy >infocom - files=`git diff-files -p` + files=$(git diff-files -p) test_expect_success \ "Racy GIT trial #$trial part A" \ 'test "" != "$files"' @@ -23,7 +23,7 @@ do echo xyzzy >cornerstone git update-index --add cornerstone - files=`git diff-files -p` + files=$(git diff-files -p) test_expect_success \ "Racy GIT trial #$trial part B" \ 'test "" != "$files"' -- 1.7.10.4