public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: [Bug] bash' read builtin command behaves differently on '\r' (4.3.33)
Date: Thu, 14 May 2015 20:00:00 -0000	[thread overview]
Message-ID: <5554FD42.1060406@redhat.com> (raw)
In-Reply-To: <20150514223211.790926b378d251d4b25dc82b@nm.ru>

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

On 05/14/2015 01:32 PM, Mikhail Usenko wrote:
> 
> Cygwin version: 2.0.2-1
> 
> [linux]$ bash --version
>   GNU bash, version 4.3.33(1)-release (i686-redhat-linux-gnu)
> [cygwin]$ bash --version
>   GNU bash, version 4.3.33(1)-release (x86_64-unknown-cygwin)
> 
> Testcase:
> [linux]$ echo -ne "\r\n" | { read t; echo "$t"; } | od -A n -t x1

echo -n is not portable; use printf instead:

printf %s '\r\n'

or with a bash-ism:

printf $'\r\n'

>   0d 0a
> [cygwin]$ echo -ne "\r\n" | { read t; echo "$t"; } | od -A n -t x1
>   0a

Umm, are you sure you haven't turned on the igncr shell option in your
cygwin environment?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-05-14 19:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 19:52 Mikhail Usenko
2015-05-14 20:00 ` Eric Blake [this message]
2015-05-14 20:18   ` Mikhail Usenko
2015-05-14 20:54   ` Mikhail Usenko
2015-05-14 22:23     ` Eric Blake
2015-09-24 16:55 ` Eric Blake

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=5554FD42.1060406@redhat.com \
    --to=eblake@redhat.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).