This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: cygwin 1.3.12 problem with using pipes
- From: David MacMahon <cygwin at smartsc dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 24 Jul 2002 19:56:53 -0700
- Subject: Re: cygwin 1.3.12 problem with using pipes
- References: <039b01c23334$6471c9d0$0d32a8c0@ids.de>
I don't know whether this is related to your problem, but I've observed
the following behavior...
$ cat foo.sh
#!/bin/bash
foo="$(echo A;echo B;echo C;echo D)"
echo "${foo}" | od -c
echo
echo "${foo#????}" | od -c
$ ./foo.sh
0000000 A \n B \n C \n D \n
0000010
0000000 C \n D \n
0000004
$ ./foo.sh > /binmode-mount/foo.tmp && cat /binmode-mount/foo.tmp
0000000 A \n B \n C \n D \n
0000010
0000000 C \n D \n
0000004
$ ./foo.sh > /textmode-mount/foo.tmp && cat /textmode-mount/foo.tmp
0000000 A \r \n B \n C \n D \n
0000011
0000000 C \r \n D \n
0000005
Is that last one weird or what? Clearly, the extraneous carriage return
comes in during the pipe to od, but only when the script's output is
redirected to a file under a textmode mount point and only the first
newline gets an extraneous carriage return.
I'm pretty sure I get the same thing regardless of whether I have
CYGWIN=binmode or CYGWIN=nobinmode.
Dave
--
David MacMahon, President
Smart Software Consulting
http://www.smartsc.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/