* [Bug] bash' read builtin command behaves differently on '\r' (4.3.33)
@ 2015-05-14 19:52 Mikhail Usenko
2015-05-14 20:00 ` Eric Blake
2015-09-24 16:55 ` Eric Blake
0 siblings, 2 replies; 6+ messages in thread
From: Mikhail Usenko @ 2015-05-14 19:52 UTC (permalink / raw)
To: cygwin
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
0d 0a
[cygwin]$ echo -ne "\r\n" | { read t; echo "$t"; } | od -A n -t x1
0a
But then, the pipe itself is OK:
[cygwin]$ echo -e "\r" | od -A n -t x1
0d 0a
--
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bug] bash' read builtin command behaves differently on '\r' (4.3.33)
2015-05-14 19:52 [Bug] bash' read builtin command behaves differently on '\r' (4.3.33) Mikhail Usenko
@ 2015-05-14 20:00 ` Eric Blake
2015-05-14 20:18 ` Mikhail Usenko
2015-05-14 20:54 ` Mikhail Usenko
2015-09-24 16:55 ` Eric Blake
1 sibling, 2 replies; 6+ messages in thread
From: Eric Blake @ 2015-05-14 20:00 UTC (permalink / raw)
To: cygwin
[-- 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 --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bug] bash' read builtin command behaves differently on '\r' (4.3.33)
2015-05-14 19:52 [Bug] bash' read builtin command behaves differently on '\r' (4.3.33) Mikhail Usenko
2015-05-14 20:00 ` Eric Blake
@ 2015-09-24 16:55 ` Eric Blake
1 sibling, 0 replies; 6+ messages in thread
From: Eric Blake @ 2015-09-24 16:55 UTC (permalink / raw)
To: cygwin, Jeff Downs
[-- Attachment #1: Type: text/plain, Size: 939 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
> 0d 0a
> [cygwin]$ echo -ne "\r\n" | { read t; echo "$t"; } | od -A n -t x1
> 0a
>
> But then, the pipe itself is OK:
> [cygwin]$ echo -e "\r" | od -A n -t x1
> 0d 0a
Jeff Downs helped me investigate off-list, and I think he found the
culprit (a typo in input.c that requested O_TEXT when it meant B_TEXT,
when mapping from open() flags to bash's internal B_* flags). I'm
building a new bash build right now, and will shortly be posting it for
testing.
--
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 --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-24 16:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 19:52 [Bug] bash' read builtin command behaves differently on '\r' (4.3.33) Mikhail Usenko
2015-05-14 20:00 ` Eric Blake
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
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).