delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/04/15/07:57:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:from:to:subject:date:message-id
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=A7lhEPKtz3HXUxrzu8ekVjeyQVvjyuNMDOJ9x4kg6gWPYq/XctOjq
fXKSBp2epTzXi9RfGYWwPNYLEAH1RyGEPnDMa/af7bWzVhJvI8OA3h1fuqlDAxWj
dGlUaIiweF2WYM9EGWzAy8ypAMqzN/iGyNRcN0SV58Vifs1rkAx41M=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:from:to:subject:date:message-id
:mime-version:content-type:content-transfer-encoding; s=default;
bh=EQwn0uePx7isAHsC9RHCw0cjajY=; b=dKdqguQuIB/mhzFvJuTg34nN90Qs
WzaeTgaaiAaC+VtcQ+KXpg8CgHZNl8u4g/0BMVvKScUP0oGHqGp5KE7twOKu+WbJ
0hxi+YFEOKAi00qinVd1AePDSU3fC8nES1OVV2ufn2PXRSpOTxSpAk+V8goPVc3p
cd0DQmNkBjbCSQM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_COUK,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=carriage, 2017-02, 201702, contrary
X-HELO: mail-ed1-f49.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pinky-co-uk.20150623.gappssmtp.com; s=20150623; h=reply-to:from:to:subject:date:organization:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=HuIRCH4lO+AZKBTO4dHTgNCbAABy5RzfIumFzkckVB4=; b=TqMQGWPtSptEXwa9S50HhVFvKWu4IM5AjQcaV2oaYBOlbjJQCLKEitl1yTaMAe1cTF Mfy4ZUSC4YyzcpvS2DdLhOXF/Hpu9rai/t73uY9w5E4UpMAW+fh8EPf8Cs5fTNp5YGtk ZBqImRXrfkAZtxkr1O2v3ftNhS+hPy9HpIokx2jW18jQn7P5EWn3hKoR2NGtGZDlGBf3 0E8WoMbqwvE0Imuwf5ycFn+nkqdUubFFRN+EZYDAi35H7sVFUkrdtiVzHPvsF8Ao8bs5 2+Y4FoI2XzCvesle8YPgiikf0K/hrGc/j2qhgCccyWkTNc8xkxgGqEM+jQJt1LA7b6XE bHLw==
Reply-To: <chris DOT day AT pinky DOT co DOT uk>
From: <chris DOT day AT pinky DOT co DOT uk>
To: <cygwin AT cygwin DOT com>
Subject: carriage return newline being appended when using redirection in binary mode
Date: Mon, 15 Apr 2019 12:56:46 +0100
Message-ID: <004201d4f382$4da27ee0$e8e77ca0$@pinky.co.uk>
MIME-Version: 1.0

Hi -

I'm having problems with carriage return newline being appended when using
redirection in binary mode. If I pipe to cat and redirect the newline is
preserved, which is odd.

CYGWIN_NT-10.0 edmund 3.0.6(0.338/5/3) 2019-04-06 16:18 x86_64 Cygwin

chrisd AT edmund:chrisd > mount
E:/abinitio/cygwin/bin on /usr/bin type ntfs (binary,auto)
E:/abinitio/cygwin/lib on /usr/lib type ntfs (binary,auto)
E:/abinitio/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
E: on /cygdrive/e type ntfs (binary,posix=0,user,noumount,auto)
F: on /cygdrive/f type ntfs (binary,posix=0,user,noumount,auto)
G: on /cygdrive/g type ntfs (binary,posix=0,user,noumount,auto)
H: on /cygdrive/h type vfat (binary,posix=0,user,noumount,auto)
Q: on /cygdrive/q type ntfs (binary,posix=0,user,noumount,auto)
chrisd AT edmund:chrisd > echo "Hello"
Hello
chrisd AT edmund:chrisd > echo "Hello"  | od -c
0000000   H   e   l   l   o  \n
0000006
chrisd AT edmund:chrisd > echo "Hello"  > foo.txt
chrisd AT edmund:chrisd > od -c foo.txt
0000000   H   e   l   l   o  \r  \n
0000007
chrisd AT edmund:chrisd > echo "Hello"  | cat > foo.txt
chrisd AT edmund:chrisd > od -c foo.txt
0000000   H   e   l   l   o  \n
0000006

This does seem contrary to the following posts

https://sourceware.org/ml/cygwin/2017-02/msg00152.html
https://sourceware.org/ml/cygwin/2017-02/msg00188.html
https://sourceware.org/ml/cygwin/2017-02/msg00189.html



Cheers

Chris Day


c: +44 7930 909 297
p: +44 115 714 0869
s: bigchrisday
https://www.linkedin.com/in/chrisdayabinitio/



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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