From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution Date: Tue, 22 Dec 2015 16:27:50 +0100 Message-ID: <1450798073-22811-8-git-send-email-gitter.spiros@gmail.com> References: <1450798073-22811-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Dec 22 16:28:36 2015 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 1aBOrc-0002YC-6U for gcvg-git-2@plane.gmane.org; Tue, 22 Dec 2015 16:28:36 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755225AbbLVP2U (ORCPT ); Tue, 22 Dec 2015 10:28:20 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35421 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754560AbbLVP2F (ORCPT ); Tue, 22 Dec 2015 10:28:05 -0500 Received: by mail-pa0-f48.google.com with SMTP id jx14so91028456pad.2 for ; Tue, 22 Dec 2015 07:28:05 -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=WSsDRh69oBpfKAWMIs4OusM9uM9fLT116GhqKljPyzI=; b=G76KS5DubAv9oeS+A0L9ITLSP+OW+wLu/Mf06k+3IFwT/+NVqJAc6N1OJ6up/uJ0mO p3pIpw4c+J+AK8YaqnSxgl3Jz+eBrMnTQWXTuVnw7xx6GHKo1GDkbtTLPOUDr6BPHnsG Vy4S36QlLbNh64hFP6XTlDk41t4Dtnds3hxz9QM2sXyNHJfqaAhKeOkgjyHBM8p6uH9X /C0qhAnUhK4UfBwp9pdDxrSqmt1r5Wd32c/H7iYUq+HxwqDo9gtvF/AK6nzzu5LpvCJ/ ZNgdmyxvhJurqepAFNO2Vi7DmDCZdben+jI+QZTplgCkeSt69eDhQQdquR8iUo5Bvorv nu5g== X-Received: by 10.66.255.10 with SMTP id am10mr36588161pad.79.1450798085016; Tue, 22 Dec 2015 07:28:05 -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 q190sm42030149pfq.59.2015.12.22.07.28.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 07:28:04 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1450798073-22811-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/t5100-mailinfo.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh index e97cfb2..4e52b3b 100755 --- a/t/t5100-mailinfo.sh +++ b/t/t5100-mailinfo.sh @@ -9,9 +9,9 @@ test_description='git mailinfo and git mailsplit test' test_expect_success 'split sample box' \ 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last && - last=`cat last` && + last=$(cat last) && echo total is $last && - test `cat last` = 17' + test $(cat last) = 17' check_mailinfo () { mail=$1 opt=$2 @@ -23,7 +23,7 @@ check_mailinfo () { } -for mail in `echo 00*` +for mail in $(echo 00*) do test_expect_success "mailinfo $mail" ' check_mailinfo $mail "" && @@ -47,11 +47,11 @@ test_expect_success 'split box with rfc2047 samples' \ 'mkdir rfc2047 && git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \ >rfc2047/last && - last=`cat rfc2047/last` && + last=$(cat rfc2047/last) && echo total is $last && - test `cat rfc2047/last` = 11' + test $(cat rfc2047/last) = 11' -for mail in `echo rfc2047/00*` +for mail in $(echo rfc2047/00*) do test_expect_success "mailinfo $mail" ' git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info && -- 2.3.3.GIT