From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 006/14] git-fetch.sh: use the $( ... ) construct for command substitution Date: Wed, 16 Apr 2014 10:29:50 -0700 Message-ID: <1397669398-25410-6-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:55 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 1WaTgg-0007gc-38 for gcvg-git-2@plane.gmane.org; Wed, 16 Apr 2014 19:31:54 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754831AbaDPRbl (ORCPT ); Wed, 16 Apr 2014 13:31:41 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36567 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752680AbaDPRaN (ORCPT ); Wed, 16 Apr 2014 13:30:13 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so11091245pab.24 for ; Wed, 16 Apr 2014 10:30:12 -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=M5V2FE8Q05n++zu4HejLVu3vJuer0DNSC6YM4znLYPE=; b=RzcGurgLxhgqWc0hYY6Psn+KCWU9Dqg8bNQ1HrAEwWrWAVp7DVLB1f3HSkOzcS0ine gx9xOT3ZVJR6CFKLLtgDI2z3+iUkdTm6mMEJWFBbwfoFKeK+YlVe0WeHJNbEn/LNJedq /+SJeZfkCtBKA42dzW3rRY5l2s1AsAWuKgV9gPBZ96jYsmq9RWn8njY1GpEAuSoUABgX y4dftOfD6LMN3dHtoBbH4PM8ofpHlFssKRp6rdRUQZXIoH3ZNFLMBq/Zvfhpor/QPwU8 VJsYTimQb2QMtMrCnwLH5TFCSSbbIQa3GJcFsB0F6me+7LXvYpp6CuJ4SdMAkgeVexaM +qaw== X-Received: by 10.66.191.39 with SMTP id gv7mr9854047pac.150.1397669412818; Wed, 16 Apr 2014 10:30:12 -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.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 10:30:12 -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-fetch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/examples/git-fetch.sh b/contrib/examples/git-fetch.sh index a314273..5540709 100755 --- a/contrib/examples/git-fetch.sh +++ b/contrib/examples/git-fetch.sh @@ -67,7 +67,7 @@ do keep='-k -k' ;; --depth=*) - shallow_depth="--depth=`expr "z$1" : 'z-[^=]*=\(.*\)'`" + shallow_depth="--depth=$(expr "z$1" : 'z-[^=]*=\(.*\)')" ;; --depth) shift @@ -262,12 +262,12 @@ fetch_per_ref () { http://* | https://* | ftp://*) test -n "$shallow_depth" && die "shallow clone with http not supported" - proto=`expr "$remote" : '\([^:]*\):'` + proto=$(expr "$remote" : '\([^:]*\):') if [ -n "$GIT_SSL_NO_VERIFY" ]; then curl_extra_args="-k" fi if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \ - "`git config --bool http.noEPSV`" = true ]; then + "$(git config --bool http.noEPSV)" = true ]; then noepsv_opt="--disable-epsv" fi -- 1.7.10.4