From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Kastrup Subject: Re: [PATCH v2 001/142] check-builtins.sh: use the $( ... ) construct for command substitution Date: Tue, 25 Mar 2014 21:32:44 +0100 Message-ID: <8738i6uihf.fsf@fencepost.gnu.org> References: <1395768283-31135-1-git-send-email-gitter.spiros@gmail.com> <1395768283-31135-2-git-send-email-gitter.spiros@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Elia Pinto , git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Wed Mar 26 12:51: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 1WSmNB-0007iA-ME for gcvg-git-2@plane.gmane.org; Wed, 26 Mar 2014 12:51:58 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754328AbaCZLvy convert rfc822-to-quoted-printable (ORCPT ); Wed, 26 Mar 2014 07:51:54 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:59759 "EHLO fencepost.gnu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753126AbaCZLvv convert rfc822-to-8bit (ORCPT ); Wed, 26 Mar 2014 07:51:51 -0400 Received: from localhost ([127.0.0.1]:58797 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSmN4-0007PR-IG; Wed, 26 Mar 2014 07:51:50 -0400 Received: by lola (Postfix, from userid 1000) id A5101E3856; Tue, 25 Mar 2014 21:32:44 +0100 (CET) In-Reply-To: (Junio C. Hamano's message of "Tue, 25 Mar 2014 12:57:56 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano writes: > Elia Pinto writes: > >> The Git CodingGuidelines prefer the $( ... ) construct for command >> substitution instead of using the back-quotes, or grave accents (`..= `). >> >> The backquoted form is the historical method for command substitutio= n, >> 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 ba= ckslash >> character. Because of this the POSIX shell adopted the $(=E2=80=A6) = feature from >> the Korn shell. >> >> The patch was generated by the simple script >> >> for _f in $(find . -name "*.sh") >> do >> =C2=A0 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} >> done > > "and then carefully proofread" is sorely needed here. It would already help to skip comment lines. --=20 David Kastrup