From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 03/10] t/t6002-rev-list-bisect.sh: use the $( ... ) construct for command substitution Date: Thu, 7 Jan 2016 14:51:43 +0100 Message-ID: <1452174710-28188-4-git-send-email-gitter.spiros@gmail.com> References: <1452174710-28188-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Thu Jan 07 14:52:22 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 1aHAzF-00024f-Cq for gcvg-git-2@plane.gmane.org; Thu, 07 Jan 2016 14:52:21 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbcAGNwA (ORCPT ); Thu, 7 Jan 2016 08:52:00 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33903 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbcAGNv6 (ORCPT ); Thu, 7 Jan 2016 08:51:58 -0500 Received: by mail-pa0-f43.google.com with SMTP id uo6so241077490pac.1 for ; Thu, 07 Jan 2016 05:51:58 -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=nDKfx4Y0MaoX2YqetikQpeLHMnV1YOw+lNEceby3z0c=; b=rLDy7cskp3U1s5IF6oufHLb+JIsqxcNbNY2loo2yEj43/IN09NAQ9xr4gciMlDcVRI yXPvyfd/w8MDE6PIAA2OLU9sinufqWMidtytfw7gTdGhLa+ANjTeUIEhn8QtctEBLviD ZNgq34szusHonnzyfsKSX4ZQys4eCzCNrZrJll2lXVJTqgGqQCB3eTRiwQK28SjCO3DW S1skMMjokeYZBu0NWujEvIpprkyvdtEcEn5J+T3eHiN1i9mfsKy2AYn1DFKa/lSZBs7V noMZCXdns5Zl4uR2JlOJbW7InpWllrlbHv59lm+dyFhH3cv4HnNWD9KlgdoBAP9BBdZB Vw9Q== X-Received: by 10.67.14.74 with SMTP id fe10mr152939584pad.151.1452174718435; Thu, 07 Jan 2016 05:51:58 -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 kk5sm140627824pab.16.2016.01.07.05.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 05:51:57 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452174710-28188-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/t6002-rev-list-bisect.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh index 43ad772..3bf2759 100755 --- a/t/t6002-rev-list-bisect.sh +++ b/t/t6002-rev-list-bisect.sh @@ -27,9 +27,9 @@ test_bisection_diff() # Test if bisection size is close to half of list size within # tolerance. # - _bisect_err=`expr $_list_size - $_bisection_size \* 2` - test "$_bisect_err" -lt 0 && _bisect_err=`expr 0 - $_bisect_err` - _bisect_err=`expr $_bisect_err / 2` ; # floor + _bisect_err=$(expr $_list_size - $_bisection_size \* 2) + test "$_bisect_err" -lt 0 && _bisect_err=$(expr 0 - $_bisect_err) + _bisect_err=$(expr $_bisect_err / 2) ; # floor test_expect_success \ "bisection diff $_bisect_option $_head $* <= $_max_diff" \ -- 2.3.3.GIT