Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 Reply-To: cygwin AT cygwin DOT com To: Roman Belenov cc: cygwin AT cygwin DOT com Subject: Re: Erroneous line endings (cat,gawk,text mount) In-Reply-To: Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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;} 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). > > > This is just a bug report, I don't expect timely reaction of any kind. > 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/