From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 03/14] t0020-crlf.sh: use the $( ... ) construct for command substitution Date: Mon, 28 Apr 2014 05:57:26 -0700 Message-ID: <1398689857-17014-3-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:58:03 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 1Wel8B-0003i6-5e for gcvg-git-2@plane.gmane.org; Mon, 28 Apr 2014 14:57:59 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755795AbaD1M5w (ORCPT ); Mon, 28 Apr 2014 08:57:52 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:50001 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755564AbaD1M5o (ORCPT ); Mon, 28 Apr 2014 08:57:44 -0400 Received: by mail-pb0-f50.google.com with SMTP id md12so5820409pbc.23 for ; Mon, 28 Apr 2014 05:57:44 -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=fY3KDkVw1QUmlKtsTeGYMLV6ztaBDLK6QJYDt26eUrQ=; b=QLrx/Fj+n3QJntUUJ4QPu877Vkv/mF62LG3W1Kt0KP+GVnmaQxbAgcKU9tkgEJKSFQ l4Nz6r2FnAEYxzkqRFAc55ugrZTu6N8CNYB6UxnDR7sOTEIypYgJU7bce/KXoiJ1XbaG J652Y4wZ4V14NRpn9ClLiZVHVe0e49TTbPFbaqQeI5BqZ6n1adAec1p3nc9WxCsgbzpN mGfK4wOgBQ/vTpi8E9ugyZgW60tFjOOkdajXqgJCdv2aOUFTxefXRb9Y/KLtCRZPfivg zwHSSQ8ALVnYlz5LL4JxzbE5vqg7ItCuPs6kiQ73WdpCNlab/LIumjX1G3nuU0uqeWSY Sd3Q== X-Received: by 10.68.254.5 with SMTP id ae5mr25086982pbd.83.1398689864371; Mon, 28 Apr 2014 05:57:44 -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.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:57:43 -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/t0020-crlf.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index e526184..d2e51a8 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -20,14 +20,14 @@ test_expect_success setup ' git commit -m initial && - one=`git rev-parse HEAD:one` && - dir=`git rev-parse HEAD:dir` && - two=`git rev-parse HEAD:dir/two` && - three=`git rev-parse HEAD:three` && + one=$(git rev-parse HEAD:one) && + dir=$(git rev-parse HEAD:dir) && + two=$(git rev-parse HEAD:dir/two) && + three=$(git rev-parse HEAD:three) && for w in Some extra lines here; do echo $w; done >>one && git diff >patch.file && - patched=`git hash-object --stdin