From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 02/10] t/t7406-submodule-update.sh: use the $( ... ) construct for command substitution Date: Fri, 8 Jan 2016 12:06:20 +0100 Message-ID: <1452251188-12939-3-git-send-email-gitter.spiros@gmail.com> References: <1452251188-12939-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jan 08 12:07:05 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 1aHUsp-0003A1-A5 for gcvg-git-2@plane.gmane.org; Fri, 08 Jan 2016 12:07:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754574AbcAHLGg (ORCPT ); Fri, 8 Jan 2016 06:06:36 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36429 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbcAHLGf (ORCPT ); Fri, 8 Jan 2016 06:06:35 -0500 Received: by mail-pf0-f195.google.com with SMTP id n128so618254pfn.3 for ; Fri, 08 Jan 2016 03:06:35 -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=++6sgcWFacWaHlGPz2aytaKee3WsB2wB9MKXqgYukME=; b=eCWWBTS0S6kGlcqzJszEGaL5mzqHe6CR1IixnOEWyrn26HSDr6yAc4hWaSVSuXGJlL mEC8xkZVSsO7g/ZpXrMKsOQfAmQnq0uVjinOQ53ph3HnE9xvWbZeIaP9/i0+hKIlxrDx 5rmmnRwP7nInCcac2j4IRHiQLYrkTh48JiueOpDloFlYVAs/4Mxb5cSvsrhjLFLzCt5c O4T3H7WdbMvH4xZruhk6OkYjQdsA24HlohM81nCkO3r5Cyi6aZlSKW7P+syx4WaREDNI KbuJn9QvSJg9bVhFi6ARCClnUEZB3Pzgnrff6nB8c+kjs5CB+drf0F43sfUiP5wHTYpd 6IZQ== X-Received: by 10.98.72.87 with SMTP id v84mr1897141pfa.15.1452251195367; Fri, 08 Jan 2016 03:06:35 -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 fi16sm93143771pac.12.2016.01.08.03.06.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 03:06:34 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452251188-12939-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/t7406-submodule-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index dda3929..68ea31d 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -14,8 +14,8 @@ submodule and "git submodule update --rebase/--merge" does not detach the HEAD. compare_head() { - sha_master=`git rev-list --max-count=1 master` - sha_head=`git rev-list --max-count=1 HEAD` + sha_master=$(git rev-list --max-count=1 master) + sha_head=$(git rev-list --max-count=1 HEAD) test "$sha_master" = "$sha_head" } -- 2.3.3.GIT