delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/22/09:24:37

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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 22 Apr 2003 09:24:26 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Roman Belenov <rbelenov AT yandex DOT ru>
cc: cygwin AT cygwin DOT com
Subject: Re: Erroneous line endings (cat,gawk,text mount)
In-Reply-To: <uk7dtgy5g.fsf@yandex.ru>
Message-ID: <Pine.GSO.4.44.0304220913480.19398-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Thu, 17 Apr 2003, Roman Belenov wrote:

> I encountered that cygwin tools can generate file with strange line
> endings in certain situation. I have a file (name it foo.txt) with
> dos-style line endings in  text mounted directory. If I do
>     gawk {print;} <foo.txt >bar.txt
> or
>     cat foo.txt >bar.txt
> I get a copy of foo.txt. But if I do
>     cat foo.txt | gawk {print;} >bar.txt
> I get 0xd doubled in line separators (so lines are separated with 0xd
> 0xd 0xa in bar.txt).
>
> <disclaimer>
> This is just a bug report, I don't expect timely reaction of any kind.
> </disclaimer>

FWIW, I've reproduced this on Win2k with CYGWIN=nobinmode on a text mount:

$ mount
...
c:\temp on /TEMP type user (textmode)
...
$ echo $CYGWIN
nobinmode
$ cd /TEMP
$ (echo;echo;echo;echo) > aaa
$ od -ba aaa
0000000 015 012 015 012 015 012 015 012
         cr  nl  cr  nl  cr  nl  cr  nl
0000010
$ gawk '{print;}' < aaa | cat > bbb; od -ba bbb
0000000 012 012 012 012
         nl  nl  nl  nl
0000004
$ cat AAA | gawk '{print;}' > bbb; od -ba bbb
0000000 015 015 012 015 015 012 015 015 012 015 015 012
         cr  cr  nl  cr  cr  nl  cr  cr  nl  cr  cr  nl
0000014
$ cygcheck -c cygwin gawk
Cygwin Package Information
Package              Version
cygwin               1.3.22-1
gawk                 3.1.2-2

Use -h to see help about each section
$

Hope this helps,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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