From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 002/14] install-webdoc.sh: use the $( ... ) construct for command substitution Date: Wed, 16 Apr 2014 10:29:46 -0700 Message-ID: <1397669398-25410-2-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:43 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 1WaTgV-0007ID-08 for gcvg-git-2@plane.gmane.org; Wed, 16 Apr 2014 19:31:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754774AbaDPRaM (ORCPT ); Wed, 16 Apr 2014 13:30:12 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:53820 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752680AbaDPRaI (ORCPT ); Wed, 16 Apr 2014 13:30:08 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so11093766pbb.36 for ; Wed, 16 Apr 2014 10:30:07 -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=KSVfH5KRZMQqmyo8aOE5E3dsC5zYiquKpyAOzEJmCPs=; b=YelHXs8RRJ11b/Ibh7J/dqFSYJHX0ULEkvBjX32oX287/kn3ITf71c1mNC3V+chonp Ft/p93cbC/8kyPZg32bwmA/unRLHEqNZGAE1KMC7+4RT/+0KkC7AUnamxOWez+xqLDVC gORQJu62bpuDRPeTh9e92RAf06ZleLx/0J2iJ3bFGlT/pfepqQTwN1ePfl7QUfPH79Q2 sRpryAz5510DQ2XTNYHAKJb7ezAKGJ0GoqFYfL598AoZl3OSOfcD9U19xa0gadzOEroN KC6sUfwZCpfghpooBg9fSKXZEbpSPjfUfZsTvcrJQESxEtTWbRcCtfk5WveCDf+o6lF8 +lSQ== X-Received: by 10.68.201.10 with SMTP id jw10mr9891521pbc.25.1397669407680; Wed, 16 Apr 2014 10:30:07 -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.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 10:30:06 -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 --- Documentation/install-webdoc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh index 76d69a9..ed8b4ff 100755 --- a/Documentation/install-webdoc.sh +++ b/Documentation/install-webdoc.sh @@ -18,17 +18,17 @@ do else echo >&2 "# install $h $T/$h" rm -f "$T/$h" - mkdir -p `dirname "$T/$h"` + mkdir -p $(dirname "$T/$h") cp "$h" "$T/$h" fi done -strip_leading=`echo "$T/" | sed -e 's|.|.|g'` +strip_leading=$(echo "$T/" | sed -e 's|.|.|g') for th in \ "$T"/*.html "$T"/*.txt \ "$T"/howto/*.txt "$T"/howto/*.html \ "$T"/technical/*.txt "$T"/technical/*.html do - h=`expr "$th" : "$strip_leading"'\(.*\)'` + h=$(expr "$th" : "$strip_leading"'\(.*\)') case "$h" in RelNotes-*.txt | index.html) continue ;; esac -- 1.7.10.4