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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to