This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug] bash' read builtin command behaves differently on '\r' (4.3.33)


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: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]