delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/24/22:46:31

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 24 Jul 2002 19:56:53 -0700
From: David MacMahon <cygwin AT smartsc DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin 1.3.12 problem with using pipes
Message-ID: <20020724195653.A1681@SmartSC.com>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <039b01c23334$6471c9d0$0d32a8c0 AT ids DOT de>
Mime-Version: 1.0
User-Agent: Mutt/1.3.22.1i

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019