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