From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 02/12] t9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 11:49:28 +0000 Message-ID: <1452599378-47882-3-git-send-email-gitter.spiros@gmail.com> References: <1452599378-47882-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jan 12 12:49:53 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 1aIxST-0007gs-4O for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 12:49:53 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934876AbcALLtr (ORCPT ); Tue, 12 Jan 2016 06:49:47 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32872 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933971AbcALLto (ORCPT ); Tue, 12 Jan 2016 06:49:44 -0500 Received: by mail-wm0-f65.google.com with SMTP id u188so30860705wmu.0 for ; Tue, 12 Jan 2016 03:49:44 -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=KAvLoGTus628fvo1DE9GYKOxDT/M4CSsGHjAwAebl7Q=; b=pVhNQabE8cGHjZnuKwSv9ZFpPIFTd52AcBEPMmkjVC53sqPkourPK6ofutpJgfQKKv I/h9fkpoxN7xwmyBgp//McQRiBW40UuSKJJvWpCe4GZRUGygiLg1XvdTrZWN9yI5Hhlx V1XSguueAMQvoob0ixp0tvwN5MM+iCJeaCt48Syh8ve3hph/Ly2s4DkFg69OuVx4KYHG ADm6rpaTE0j5cl1q/euomr3m1PSp7ECtIJyfsR0R/e/ALEm4uosIeYQNS8oG4Wk8eUPX pWt4/SCEmgWjZlRnDOEnALlBeB/eGk2c02OXDgut7QAjW0hBTv/0vh+eWJaWqasZ5CES dMWw== X-Received: by 10.194.234.41 with SMTP id ub9mr20515097wjc.9.1452599383490; Tue, 12 Jan 2016 03:49:43 -0800 (PST) Received: from ubuntu2pinto.pd5x2phgis1evm2itoce0l41ib.ax.internal.cloudapp.net ([40.113.119.92]) by smtp.gmail.com with ESMTPSA id k130sm3506702wmg.6.2016.01.12.03.49.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 03:49:43 -0800 (PST) X-Mailer: git-send-email 2.7.0.rc0.20.g4b9ab0e.dirty In-Reply-To: <1452599378-47882-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/t9129-git-svn-i18n-commitencoding.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t9129-git-svn-i18n-commitencoding.sh b/t/t9129-git-svn-i18n-commitencoding.sh index 8cfdfe7..39b6bcb 100755 --- a/t/t9129-git-svn-i18n-commitencoding.sh +++ b/t/t9129-git-svn-i18n-commitencoding.sh @@ -7,7 +7,7 @@ test_description='git svn honors i18n.commitEncoding in config' . ./lib-git-svn.sh compare_git_head_with () { - nr=`wc -l < "$1"` + nr=$(wc -l < "$1") a=7 b=$(($a + $nr - 1)) git cat-file commit HEAD | sed -ne "$a,${b}p" >current && @@ -29,7 +29,7 @@ fi compare_svn_head_with () { # extract just the log message and strip out committer info. # don't use --limit here since svn 1.1.x doesn't have it, - LC_ALL="$a_utf8_locale" svn log `git svn info --url` | perl -w -e ' + LC_ALL="$a_utf8_locale" svn log $(git svn info --url) | perl -w -e ' use bytes; $/ = ("-"x72) . "\n"; my @x = ; -- 2.5.0