delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/09/12/09:06:50

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:cc:from:message-id:date
:mime-version:in-reply-to:content-type; q=dns; s=default; b=CubE
4Ma9r1Sjamq4tXs2cTLgyEYv8uixWI638xLdLwnAEE9ggJ66dEXNiRhIH2CHVjzL
kDFA+ZPtMTfYNKv1N/562Rgdx8XPBklI1xxf0Lk/V+1URnY9md8dzEHlaid7mbQn
yaLqG91MjtxZxp+71xMytlyJY3WamUI77fkew80=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:cc:from:message-id:date
:mime-version:in-reply-to:content-type; s=default; bh=WlYk4M7U+7
P5C7qmsiadnRi2CsE=; b=dwwpujYdSq7xD8CuTG5Jr2CW1aNE3PHTy2D7QlJ+rO
+FGF/2lsjlgRljcVF1zszngpw18x9NQhy4zRq0mfwj4w7RCace+WL/Y6exON/bEo
3NwJcE41+DUWOiHC3ba8QbEPrLNK9XVg2BRn+nZkONTyYQWHjPxJ4uChSUfOGaCc
M=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
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 AT redhat DOT com
Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0
To: Nikolay Melekhin <nikolay DOT melekhin AT gmail DOT com>
References: <CAAq9174Ffd-zFLrCsUSz5DcxW8DYaeQbxsPxWMH0bh0vPBJCLA AT mail DOT gmail DOT com> <7ed18312-4929-8299-d186-9cb0aa541a93 AT redhat DOT com> <CAAq9174TrUGOr+y4GvMWEqNXao-zyemptuoSM8_Jna33qwpjiw AT mail DOT gmail DOT com>
Cc: cygwin AT cygwin DOT com
From: Eric Blake <eblake AT redhat DOT com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Message-ID: <61150261-b3c4-d5e5-23ff-a4320a19715c@redhat.com>
Date: Tue, 12 Sep 2017 08:06:30 -0500
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: <CAAq9174TrUGOr+y4GvMWEqNXao-zyemptuoSM8_Jna33qwpjiw@mail.gmail.com>
X-IsSubscribed: yes

--EJClDEsE8wgeCUACreUVqIJVIbvaD65ch
Content-Type: multipart/mixed; boundary="dx5lAjEgDgxJX32pkRnfWKtpU9PJCJxQa";
 protected-headers="v1"
From: Eric Blake <eblake AT redhat DOT com>
To: Nikolay Melekhin <nikolay DOT melekhin AT gmail DOT com>
Cc: cygwin AT cygwin DOT com
Message-ID: <61150261-b3c4-d5e5-23ff-a4320a19715c AT redhat DOT com>
Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0
References: <CAAq9174Ffd-zFLrCsUSz5DcxW8DYaeQbxsPxWMH0bh0vPBJCLA AT mail DOT gmail DOT com>
 <7ed18312-4929-8299-d186-9cb0aa541a93 AT redhat DOT com>
 <CAAq9174TrUGOr+y4GvMWEqNXao-zyemptuoSM8_Jna33qwpjiw AT mail DOT gmail DOT com>
In-Reply-To: <CAAq9174TrUGOr+y4GvMWEqNXao-zyemptuoSM8_Jna33qwpjiw AT mail DOT gmail DOT com>


--dx5lAjEgDgxJX32pkRnfWKtpU9PJCJxQa
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

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"

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019