From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6949 invoked by alias); 12 Sep 2017 13:06:36 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 6923 invoked by uid 89); 12 Sep 2017 13:06:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=carriage, H*M:b3c4 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Sep 2017 13:06:33 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2EBED81DED; Tue, 12 Sep 2017 13:06:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2EBED81DED Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=eblake@redhat.com Received: from [10.10.120.44] (ovpn-120-44.rdu2.redhat.com [10.10.120.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id B53A660E3E; Tue, 12 Sep 2017 13:06:31 +0000 (UTC) Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0 To: Nikolay Melekhin References: <7ed18312-4929-8299-d186-9cb0aa541a93@redhat.com> Cc: cygwin@cygwin.com From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Message-ID: <61150261-b3c4-d5e5-23ff-a4320a19715c@redhat.com> Date: Tue, 12 Sep 2017 13:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EJClDEsE8wgeCUACreUVqIJVIbvaD65ch" X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00136.txt.bz2 --EJClDEsE8wgeCUACreUVqIJVIbvaD65ch Content-Type: multipart/mixed; boundary="dx5lAjEgDgxJX32pkRnfWKtpU9PJCJxQa"; protected-headers="v1" From: Eric Blake To: Nikolay Melekhin Cc: cygwin@cygwin.com Message-ID: <61150261-b3c4-d5e5-23ff-a4320a19715c@redhat.com> Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0 References: <7ed18312-4929-8299-d186-9cb0aa541a93@redhat.com> In-Reply-To: --dx5lAjEgDgxJX32pkRnfWKtpU9PJCJxQa Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Content-length: 829 On 09/12/2017 12:38 AM, Nikolay Melekhin wrote: > https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution >=20 > "...with any trailing newlines deleted." That is why I expected that > bash should remove trailing newlines in command substitution results, > which are CRLF on Windows. No, newlines are LF. CR are carriage returns, not newlines. >>From my point of view, bash in Cygwin should follow the same rule on > Linux and Windows: remove trailing newlines in command substitution. That's exactly what it does, newlines only by default. > So remove trailing CRLF on Windows. CR are not newlines. Cygwin apps don't generate CR by default, so bash doesn't strip CR by default. --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --dx5lAjEgDgxJX32pkRnfWKtpU9PJCJxQa-- --EJClDEsE8wgeCUACreUVqIJVIbvaD65ch Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 619 -----BEGIN PGP SIGNATURE----- Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlm329cACgkQp6FrSiUn Q2rFvQf/aDdCJEAoX/9QvrdUQaa5+3LvKI3QyiQUJ6uMMsaCDsgNWdmMYLKzQ+pT 394/6oAFepFUWvdGMoSIWE3hRwHgdLRMfT4K7fu+DKFVlJLs5VBmQ6sEqUjR0BsU J/U6XwTSj/XAv+h0dLL1mN/x/V4nCHm54R0GHJ2fYMWlG+ydR+MpWiMqp+yaE9w/ pfY1XwGzGN5f2JKagAv9LvbbDAu98nyR9k6LsxR/Q9P7RgQMw3EMWw8n25lyHUOl 87yZMaIMIfTehlHWqk7maNcTulyKQu7+OPov/yf8W65h1YjuzzDK0Zs7iL6UMbfx EcHK1trvNtqSbkqPbMhW1OU8MV1drQ== =itwY -----END PGP SIGNATURE----- --EJClDEsE8wgeCUACreUVqIJVIbvaD65ch--