From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 010/14] git-resolve.sh: use the $( ... ) construct for command substitution Date: Wed, 16 Apr 2014 10:29:54 -0700 Message-ID: <1397669398-25410-10-git-send-email-gitter.spiros@gmail.com> References: <1397669398-25410-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Apr 16 19:31:27 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 1WaTgD-0006lh-SU for gcvg-git-2@plane.gmane.org; Wed, 16 Apr 2014 19:31:26 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755325AbaDPRaW (ORCPT ); Wed, 16 Apr 2014 13:30:22 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:40885 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755085AbaDPRaS (ORCPT ); Wed, 16 Apr 2014 13:30:18 -0400 Received: by mail-pb0-f44.google.com with SMTP id rp16so11114149pbb.17 for ; Wed, 16 Apr 2014 10:30:17 -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=Y1vr/Zr6HAhDGtXukyL4FO4oA7rws0H1MlHU/3Cry7U=; b=T/lHO8hCy7NS9BeRcUlxic7DrEIDNfI4MP+kRCRMfBGAS22hX3wyaoDkGDPZHfwsM7 AmHS1rnUuHSI/CPUDJArua0iQqzU3edivBlR0PhxU+2+McZUs2l02BXpiG9eQTgP7p2A 0g7yIZp9tqLiqJqDwHmdAs573DwYB7WLmfDJ8lnQ1F9q+3JvVldFiY71U52heo/48TZw I0qNd8OVdIxCBeXcl/7ZCIB10T/vA+qnv0yE6frxYvMwAB1tROrmXL3aBFDzSpBbS0Bh HDnhh078v8u3YaMk2BDKC+jjm/5tOqV83G/++KThkIteUwSRErbV1oUHm0f9gBZ/K36G pjIQ== X-Received: by 10.66.240.4 with SMTP id vw4mr9967571pac.26.1397669417622; Wed, 16 Apr 2014 10:30:17 -0700 (PDT) Received: from devzero2000ubu.nephoscale.com (140.195.207.67.nephoscale.net. [67.207.195.140]) by mx.google.com with ESMTPSA id z3sm113974244pas.15.2014.04.16.10.30.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 10:30:16 -0700 (PDT) X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397669398-25410-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 --- contrib/examples/git-resolve.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/examples/git-resolve.sh b/contrib/examples/git-resolve.sh index 8f98142..48d0fc9 100755 --- a/contrib/examples/git-resolve.sh +++ b/contrib/examples/git-resolve.sh @@ -75,7 +75,7 @@ case "$common" in GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \ 2>/dev/null || continue # Count the paths that are unmerged. - cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l` + cnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l) if test $best_cnt -le 0 -o $cnt -le $best_cnt then best=$c -- 1.7.10.4