[Bug] bash' read builtin command behaves differently on '\r' (4.3.33)
Eric Blake
eblake@redhat.com
Thu May 14 22:23:00 GMT 2015
On 05/14/2015 02:18 PM, Mikhail Usenko wrote:
> Also when a bash script is launched from an external program
> with connected stdio from/to the program using a UNIX domain
> socket generated by socketpair() the read builtin works OK.
Thanks for the additional information. I can indeed duplicate that bash
is stripping \r\n to \n, but NOT stripping other \r, when reading from a
pipe:
$ printf ':\r:\r\n' | { read t; echo "-$t-"; } | od -tx1
0000000 2d 3a 0d 3a 2d 0a
0000006
and pipes themselves are not doing the stripping:
$ printf ':\r:\r\n' | od -tx1
0000000 3a 0d 3a 0d 0a
0000005
I also confirmed that raw files have the same problem. Possibly a bug I
introduced in my code to support igncr, so I'll try to root it out.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150514/6f65f489/attachment.sig>
More information about the Cygwin
mailing list