From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 07/14] t0300-credentials.sh: use the $( ... ) construct for command substitution Date: Mon, 28 Apr 2014 05:57:30 -0700 Message-ID: <1398689857-17014-7-git-send-email-gitter.spiros@gmail.com> References: <1398689857-17014-1-git-send-email-gitter.spiros@gmail.com> Cc: matthieu.moy@grenoble-inp.fr, Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Apr 28 14:58:58 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 1Wel97-0004sQ-Iv for gcvg-git-2@plane.gmane.org; Mon, 28 Apr 2014 14:58:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932116AbaD1M6t (ORCPT ); Mon, 28 Apr 2014 08:58:49 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:46461 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755667AbaD1M5t (ORCPT ); Mon, 28 Apr 2014 08:57:49 -0400 Received: by mail-pa0-f50.google.com with SMTP id rd3so5807241pab.9 for ; Mon, 28 Apr 2014 05:57:49 -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=dD4I58IpBUA9G5F/Pd7AuxisxkE/DCqWVy11XLdU0NQ=; b=OwgcoDGtszh88FnXqIl1Uj+BcQB7xnP7bedvKpSAV82D+VNH3SjmXBizTdILSF62cJ yfNmj/FUdkKYPvy/2NqzsFIZX8oap7UeOuiwK3EpM3hY0POGry9nHnYDI5TrQ+STk895 TpsSF4TgWFB0KwskHC79NdrXBVllKFfYjCAiVWc9RDty5+rEA7sYlk0i2ZKiFDC/5Q2U 4qF9qAxSf/cYeM58IN9nUoMv+2h6LoICQpXU7vAhVdv0LPA3Dzlyt4II+A4PPOvemi1Y Dahiy69IH+VQNEA6XGvywrS9zniUt4fYpd43YjUbQypkagaa0f9fM+msH/CcMHcbBGJk 3kxg== X-Received: by 10.68.190.163 with SMTP id gr3mr25067213pbc.103.1398689869047; Mon, 28 Apr 2014 05:57:49 -0700 (PDT) Received: from devzero2000ubu.nephoscale.com (140.195.207.67.nephoscale.net. [67.207.195.140]) by mx.google.com with ESMTPSA id ky8sm34896290pbc.64.2014.04.28.05.57.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:57:48 -0700 (PDT) X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398689857-17014-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 --- t/t0300-credentials.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh index 538ea5f..57ea5a1 100755 --- a/t/t0300-credentials.sh +++ b/t/t0300-credentials.sh @@ -6,7 +6,7 @@ test_description='basic credential helper tests' test_expect_success 'setup helper scripts' ' cat >dump <<-\EOF && - whoami=`echo $0 | sed s/.*git-credential-//` + whoami=$(echo $0 | sed s/.*git-credential-//) echo >&2 "$whoami: $*" OIFS=$IFS IFS== -- 1.7.10.4