This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Extra CR symbol from backticks on Cygwin 2.9.0


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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]