public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0
Date: Tue, 12 Sep 2017 13:03:00 -0000	[thread overview]
Message-ID: <c6430fb5-5b51-0ba4-efee-ed8fb43cdb05@gmail.com> (raw)
In-Reply-To: <CAAq9174TrUGOr+y4GvMWEqNXao-zyemptuoSM8_Jna33qwpjiw@mail.gmail.com>

On 9/12/2017 1:38 AM, Nikolay Melekhin wrote:
> Hi Eric,
> 
> Thanks! This option is what I am looking for.
> However I cannot agree with you on bash behavior in Cygwin. Section of
> command substitution in bash documentation says:
> 
> https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution
> 
> "...with any trailing newlines deleted." That is why I expected that

In POSIX and newline is simply a LF.  The fact that your input from a
Windows cmd.exe contains CR has no bearing on POSIX.

> bash should remove trailing newlines in command substitution results,
> which are CRLF on Windows.

If bash were to follow Windows semantics instead of POSIX then your
point would be valid.  However Cygwin is a POSIX emulation so your point
in this case is false.

> From my point of view, bash in Cygwin should follow the same rule on
> Linux and Windows: remove trailing newlines in command substitution.
> So remove trailing CRLF on Windows.

Since Linux and Cygwin are both POSIX then Cygwin is doing what Linux
does.  You just need to adjust the differences by properly filtering
your input.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2017-09-12 13:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 21:36 Nikolay Melekhin
2017-09-11 22:00 ` Eric Blake
2017-09-12  5:38   ` Nikolay Melekhin
2017-09-12  9:20     ` Andrey Repin
2017-09-12 13:03     ` cyg Simple [this message]
2017-09-12 13:06     ` Eric Blake
2017-09-12 13:10       ` cyg Simple
2017-09-13  0:11         ` Michel LaBarre
2017-09-13 14:34           ` cyg Simple
2017-09-13 18:47             ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6430fb5-5b51-0ba4-efee-ed8fb43cdb05@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).