Extra CR symbol from backticks on Cygwin 2.9.0

Eric Blake eblake@redhat.com
Tue Sep 12 13:06:00 GMT 2017


On 09/12/2017 12:38 AM, Nikolay Melekhin wrote:
> https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution
> 
> "...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.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170912/af9b4bec/attachment.sig>


More information about the Cygwin mailing list